mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibC: Fix dumb off-by-two in fgets() :^)
"Play C games, win C prizes."
This commit is contained in:
parent
64948fa701
commit
edac8704de
1 changed files with 1 additions and 1 deletions
|
@ -108,7 +108,7 @@ char* fgets(char* buffer, int size, FILE* stream)
|
|||
ASSERT(stream);
|
||||
ASSERT(size);
|
||||
ssize_t nread = 0;
|
||||
while (nread < (size + 1)) {
|
||||
while (nread < (size - 1)) {
|
||||
int ch = fgetc(stream);
|
||||
if (ch == EOF)
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue