aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ical.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ical.c b/src/ical.c
index 8d1735b..4360a76 100644
--- a/src/ical.c
+++ b/src/ical.c
@@ -425,10 +425,12 @@ ical_readline_init (FILE *fdi, char *buf, char *lstore, unsigned *ln)
char *eol;
*buf = *lstore = '\0';
- fgets (lstore, BUFSIZ, fdi);
- if ((eol = strchr(lstore, '\n')) != NULL)
- *eol = '\0';
- (*ln)++;
+ if (fgets (lstore, BUFSIZ, fdi))
+ {
+ if ((eol = strchr(lstore, '\n')) != NULL)
+ *eol = '\0';
+ (*ln)++;
+ }
}
static int