summaryrefslogtreecommitdiff
path: root/src/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stat.c')
-rw-r--r--src/stat.c5
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)