mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix return value of ungetc when argument is outside unsigned char range
aside from the special value EOF, ungetc is specified to accept and convert values outside the range of unsigned char. conversion takes place automatically as part of assignment when storing into the buffer, but the return value is also required to be the resulting converted value, and this requirement was not satisfied. simplified from patch by Wang Jianjian.
This commit is contained in:
parent
bff7895499
commit
f6ecd0c296
1 changed files with 1 additions and 1 deletions
|
@ -16,5 +16,5 @@ int ungetc(int c, FILE *f)
|
|||
f->flags &= ~F_EOF;
|
||||
|
||||
FUNLOCK(f);
|
||||
return c;
|
||||
return (unsigned char)c;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue