aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-11-15 21:37:37 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2011-11-15 21:37:37 +0100
commit1ff6f39c86b903499633ff13d7447fee4d81d1f6 (patch)
treedd6b7db907c4801501f3d60adf985e17daab6533 /src
parentadf769078cd85b57bc95da528609c95118e9e955 (diff)
parent5e4db62662a40fd73c911218a79bb984dc169b18 (diff)
downloadcalcurse-1ff6f39c86b903499633ff13d7447fee4d81d1f6.tar.gz
calcurse-1ff6f39c86b903499633ff13d7447fee4d81d1f6.zip
Merge branch 'maint'
Diffstat (limited to 'src')
-rw-r--r--src/io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/io.c b/src/io.c
index 2bd0ce4..f35e98f 100644
--- a/src/io.c
+++ b/src/io.c
@@ -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)
{