fix incorrect initial count in shgetc when data is already buffered

This commit is contained in:
Rich Felker 2012-04-11 00:26:41 -04:00
parent 48bb81adf8
commit 7ef1a9bba5
1 changed files with 1 additions and 1 deletions

View File

@ -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