summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--join.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/join.c b/join.c
index 4fa6c21..4c49a97 100644
--- a/join.c
+++ b/join.c
@@ -58,7 +58,7 @@ char *fgetln(FILE *stream, size_t *p_len) {
}
c = fgetc(stream);
- if (c == '\n' || c == -1) {
+ if (c == '\n' || feof(stream)) {
*p_len = len;
return len == 0? NULL: buffer;
}