mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibC: Fix dumb off-by-two in fgets() :^)
"Play C games, win C prizes."
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user