diff options
Diffstat (limited to 'text-utils/parse.c')
-rw-r--r-- | text-utils/parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/text-utils/parse.c b/text-utils/parse.c index 2557210a2..24a8407af 100644 --- a/text-utils/parse.c +++ b/text-utils/parse.c @@ -44,6 +44,7 @@ #include "hexdump.h" #include "nls.h" #include "xalloc.h" +#include "strutils.h" static void escape(char *p1); static void badcnt(const char *s); @@ -148,8 +149,7 @@ void add(const char *fmt) badfmt(fmt); } tfu->fmt = xmalloc(p - savep + 1); - strncpy(tfu->fmt, (char *)savep, p - savep); - tfu->fmt[p - savep] = '\0'; + xstrncpy(tfu->fmt, (char *)savep, p - savep + 1); escape(tfu->fmt); ++p; } |