summaryrefslogtreecommitdiffstats
path: root/src/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/event.c b/src/event.c
index 64bc3eb..4e1292b 100644
--- a/src/event.c
+++ b/src/event.c
@@ -149,7 +149,9 @@ event_scan (FILE *f, struct tm start, int id, char *note)
localtime (&t);
/* Read the event description */
- fgets (buf, sizeof buf, f);
+ if (!fgets (buf, sizeof buf, f))
+ return NULL;
+
nl = strchr (buf, '\n');
if (nl)
{