diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/hexdump/parse.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index ef19278..07ad63d 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -142,8 +142,7 @@ add(const char *fmt) badfmt(fmt); if (!(tfu->fmt = malloc(p - savep + 1))) err(1, NULL); - (void) strncpy(tfu->fmt, savep, p - savep); - tfu->fmt[p - savep] = '\0'; + (void) strlcpy(tfu->fmt, savep, p - savep + 1); escape(tfu->fmt); p++; } |