diff options
author | Jim Meyering <jim@meyering.net> | 2002-07-16 09:29:52 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-07-16 09:29:52 +0000 |
commit | 6978ba6736e6b45c8f14b6ed75f298aa3da4830d (patch) | |
tree | c6d1e3a60a2237fb92d76a59e3482b0ba84f71e8 | |
parent | 753bb04a601b68ab4ca86a64897be81956bfb207 (diff) | |
download | coreutils-6978ba6736e6b45c8f14b6ed75f298aa3da4830d.tar.xz |
(print_it): Use memcpy and a little pointer arithmetic, rather than stpncpy.
-rw-r--r-- | src/stat.c | 5 |
1 files 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) |