aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stat.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-09-21 15:19:18 +0100
committerRon Yorston <rmy@pobox.com>2021-09-21 15:19:18 +0100
commit90b3ba992ecb39e32e5a66b2e37579becc56d286 (patch)
tree4c4a2c9e1baeb8230d78efd058bb4bcabc3fd12b /coreutils/stat.c
parentdf34f5e92b1d10f0bb858d2ea6e8c249e87ac593 (diff)
parent56f0e886db0543a27f369d7f95eb9da2fb3d069c (diff)
downloadbusybox-w32-90b3ba992ecb39e32e5a66b2e37579becc56d286.tar.gz
busybox-w32-90b3ba992ecb39e32e5a66b2e37579becc56d286.tar.bz2
busybox-w32-90b3ba992ecb39e32e5a66b2e37579becc56d286.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r--coreutils/stat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 96cbf6dc6..940ade89a 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -340,7 +340,8 @@ static void FAST_FUNC print_stat(char *pformat, const char m,
340 strcat(pformat, "lo"); 340 strcat(pformat, "lo");
341 printf(pformat, (unsigned long) (statbuf->st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO))); 341 printf(pformat, (unsigned long) (statbuf->st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)));
342 } else if (m == 'A') { 342 } else if (m == 'A') {
343 printfs(pformat, bb_mode_string(statbuf->st_mode)); 343 char modestr[12];
344 printfs(pformat, bb_mode_string(modestr, statbuf->st_mode));
344 } else if (m == 'f') { 345 } else if (m == 'f') {
345 strcat(pformat, "lx"); 346 strcat(pformat, "lx");
346 printf(pformat, (unsigned long) statbuf->st_mode); 347 printf(pformat, (unsigned long) statbuf->st_mode);
@@ -703,6 +704,7 @@ static bool do_stat(const char *filename, const char *format)
703 bb_putchar('\n'); 704 bb_putchar('\n');
704# endif 705# endif
705 } else { 706 } else {
707 char modestr[12];
706 char *linkname = NULL; 708 char *linkname = NULL;
707 struct passwd *pw_ent; 709 struct passwd *pw_ent;
708 struct group *gw_ent; 710 struct group *gw_ent;
@@ -737,7 +739,7 @@ static bool do_stat(const char *filename, const char *format)
737 bb_putchar('\n'); 739 bb_putchar('\n');
738 printf("Access: (%04lo/%10.10s) Uid: (%5lu/%8s) Gid: (%5lu/%8s)\n", 740 printf("Access: (%04lo/%10.10s) Uid: (%5lu/%8s) Gid: (%5lu/%8s)\n",
739 (unsigned long) (statbuf.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)), 741 (unsigned long) (statbuf.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)),
740 bb_mode_string(statbuf.st_mode), 742 bb_mode_string(modestr, statbuf.st_mode),
741 (unsigned long) statbuf.st_uid, 743 (unsigned long) statbuf.st_uid,
742 (pw_ent != NULL) ? pw_ent->pw_name : "UNKNOWN", 744 (pw_ent != NULL) ? pw_ent->pw_name : "UNKNOWN",
743 (unsigned long) statbuf.st_gid, 745 (unsigned long) statbuf.st_gid,