summaryrefslogtreecommitdiff
path: root/src/io.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-11-11 12:12:58 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2011-11-11 12:16:35 +0100
commit120f434967f069dace3aeab9a547b62b127d2c04 (patch)
tree6affa8d9828aa84db2bead2dbcabc3f8187ca6b6 /src/io.c
parent3aefd00f6aebad7c50210e68650cb8c42e0835cd (diff)
downloadcalcurse-120f434967f069dace3aeab9a547b62b127d2c04.zip
src/io.c: Null-terminate the ical_readline() buffer
Ensure we always return with a null-terminated buffer, even if we read more than BUFSIZ characters. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/io.c b/src/io.c
index 22f8719..9dcc784 100644
--- a/src/io.c
+++ b/src/io.c
@@ -1896,6 +1896,7 @@ ical_readline (FILE *fdi, char *buf, char *lstore, unsigned *ln)
if (*lstore != SPACE && *lstore != TAB)
break;
strncat (buf, lstore + 1, BUFSIZ);
+ buf[BUFSIZ - 1] = '\0';
(*ln)++;
}