"Play C games, win C prizes."
@@ -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;