mirror of
https://github.com/fluencelabs/musl
synced 2025-06-24 12:12:04 +00:00
fix incorrect initial count in shgetc when data is already buffered
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
void __shlim(FILE *f, off_t lim)
|
void __shlim(FILE *f, off_t lim)
|
||||||
{
|
{
|
||||||
f->shlim = 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)
|
if (lim && f->rend - f->rpos > lim)
|
||||||
f->shend = f->rpos + lim;
|
f->shend = f->rpos + lim;
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user