diff options
Diffstat (limited to 'src/librc/librc-misc.c')
-rw-r--r-- | src/librc/librc-misc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index 749fd812..04c097b1 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -66,7 +66,8 @@ ssize_t rc_getline(char **line, size_t *len, FILE *fp) } p = *line + last; memset(p, 0, BUFSIZ); - fgets(p, BUFSIZ, fp); + if (fgets(p, BUFSIZ, fp) == NULL) + break; last += strlen(p); if (last && (*line)[last - 1] == '\n') { (*line)[last - 1] = '\0'; |