diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-11 12:12:58 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-11 12:16:35 +0100 |
commit | 120f434967f069dace3aeab9a547b62b127d2c04 (patch) | |
tree | 6affa8d9828aa84db2bead2dbcabc3f8187ca6b6 | |
parent | 3aefd00f6aebad7c50210e68650cb8c42e0835cd (diff) | |
download | calcurse-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>
-rw-r--r-- | src/io.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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)++; } |