mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibC: ungetc(EOF) should fail (and return EOF)
This commit is contained in:
parent
bba24b09f7
commit
64948fa701
1 changed files with 2 additions and 0 deletions
|
@ -190,6 +190,8 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream)
|
|||
int ungetc(int c, FILE* stream)
|
||||
{
|
||||
ASSERT(stream);
|
||||
if (c == EOF)
|
||||
return EOF;
|
||||
if (stream->have_ungotten)
|
||||
return EOF;
|
||||
stream->have_ungotten = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue