diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index 35b2c38b88..543f9ee7af 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -137,7 +137,10 @@ int fflush(FILE* stream) char* fgets(char* buffer, int size, FILE* stream) { ASSERT(stream); - ASSERT(size); + if (size == 0) { + return nullptr; + } + ssize_t nread = 0; while (nread < (size - 1)) { int ch = fgetc(stream);