diff options
author | eadler <eadler@FreeBSD.org> | 2013-12-11 14:54:58 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2013-12-11 14:54:58 +0000 |
commit | 7f81f436265775d8869c177c7f3a6c5a19bdf93b (patch) | |
tree | edf67ffb5b2cb69d6ea2978a9889e1500650c068 /usr.bin/calendar | |
parent | 2d679424b8f7bbbe25d3da57b486c1c64f42f238 (diff) | |
download | FreeBSD-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.c | 2 |
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; |