1
0
Эх сурвалжийг харах

fix incorrect initial count in shgetc when data is already buffered

Rich Felker 13 жил өмнө
parent
commit
7ef1a9bba5
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/internal/shgetc.c

+ 1 - 1
src/internal/shgetc.c

@@ -3,7 +3,7 @@
 void __shlim(FILE *f, off_t lim)
 {
 	f->shlim = lim;
-	f->shcnt = f->rend ? f->rend - f->buf : 0;
+	f->shcnt = f->rend - f->rpos;
 	if (lim && f->rend - f->rpos > lim)
 		f->shend = f->rpos + lim;
 	else