diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-15 21:37:37 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-15 21:37:37 +0100 |
commit | 1ff6f39c86b903499633ff13d7447fee4d81d1f6 (patch) | |
tree | dd6b7db907c4801501f3d60adf985e17daab6533 /src | |
parent | adf769078cd85b57bc95da528609c95118e9e955 (diff) | |
parent | 5e4db62662a40fd73c911218a79bb984dc169b18 (diff) | |
download | calcurse-1ff6f39c86b903499633ff13d7447fee4d81d1f6.tar.gz calcurse-1ff6f39c86b903499633ff13d7447fee4d81d1f6.zip |
Merge branch 'maint'
Diffstat (limited to 'src')
-rw-r--r-- | src/io.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1885,6 +1885,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)++; } @@ -2392,7 +2393,8 @@ ical_read_event (FILE *fdi, FILE *log, unsigned *noevents, unsigned *noapoints, skip_alarm = 0; while (ical_readline (fdi, buf, lstore, lineno)) { - memcpy (buf_upper, buf, strlen (buf)); + strncpy (buf_upper, buf, BUFSIZ); + buf_upper[BUFSIZ - 1] = '\0'; str_toupper (buf_upper); if (skip_alarm) @@ -2576,7 +2578,8 @@ ical_read_todo (FILE *fdi, FILE *log, unsigned *notodos, unsigned *noskipped, skip_alarm = 0; while (ical_readline (fdi, buf, lstore, lineno)) { - memcpy (buf_upper, buf, strlen (buf)); + strncpy (buf_upper, buf, BUFSIZ); + buf_upper[BUFSIZ - 1] = '\0'; str_toupper (buf_upper); if (skip_alarm) { |