summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2013-12-11 14:54:58 +0000
committereadler <eadler@FreeBSD.org>2013-12-11 14:54:58 +0000
commit7f81f436265775d8869c177c7f3a6c5a19bdf93b (patch)
treeedf67ffb5b2cb69d6ea2978a9889e1500650c068 /usr.bin/calendar
parent2d679424b8f7bbbe25d3da57b486c1c64f42f238 (diff)
downloadFreeBSD-src-7f81f436265775d8869c177c7f3a6c5a19bdf93b.zip
FreeBSD-src-7f81f436265775d8869c177c7f3a6c5a19bdf93b.tar.gz
calendar(1): use strlcpy instead of strncpy
use strlcpy instead of strncpy which avoids non-null-termination if the string is MAXPATHLEN bytes or longer.
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r--usr.bin/calendar/calcpp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/calendar/calcpp.c b/usr.bin/calendar/calcpp.c
index 413739b..6a15683 100644
--- a/usr.bin/calendar/calcpp.c
+++ b/usr.bin/calendar/calcpp.c
@@ -133,7 +133,7 @@ tokenscpp(char *buf, char *string)
s = p;
while(!isspace((unsigned char)*p))
p++;
- strncpy(string, s, MAXPATHLEN);
+ strlcpy(string, s, MAXPATHLEN);
return(T_DEFINE);
} else if ((p = strstr(buf, "#ifndef")) != NULL) {
p += 8;
OpenPOWER on IntegriCloud