From 6978ba6736e6b45c8f14b6ed75f298aa3da4830d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 16 Jul 2002 09:29:52 +0000 Subject: (print_it): Use memcpy and a little pointer arithmetic, rather than stpncpy. --- src/stat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stat.c b/src/stat.c index 8b42fe9d3..6939df00f 100644 --- a/src/stat.c +++ b/src/stat.c @@ -610,15 +610,14 @@ print_it (char const *masterformat, char const *filename, char *p = strchr (b, '%'); if (p != NULL) { - char *d; size_t len; *p++ = '\0'; fputs (b, stdout); len = strspn (p, "#-+.I 0123456789"); dest[0] = '%'; - d = stpncpy (dest + 1, p, len); - *d = 0; + memcpy (dest + 1, p, len); + dest[1 + len] = 0; p += len; switch (*p) -- cgit v1.2.3-70-g09d2