aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/hexdump
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2009-06-23 23:32:24 +0000
committerXin LI <delphij@FreeBSD.org>2009-06-23 23:32:24 +0000
commit884f7c03dd39df73d177908327df858f96989cc0 (patch)
treecc63c152e4d648b520982dfea92857f4214c7e5b /usr.bin/hexdump
parent431586a895fd61a880d939240d2b3dd1c24aac5d (diff)
Notes
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r--usr.bin/hexdump/parse.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c
index ef19278b486a..07ad63d0fe24 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++;
}