commit: 971640e9e61490d32b40a88fff61502ce75270e7
parent e71f5d453293684800f065ea5f03f2b98d12789c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 14 Mar 2024 02:11:23 +0100
cmd/chmod: Fix octal formatting
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmd/chmod.c b/cmd/chmod.c
@@ -46,7 +46,7 @@ do_fchmodat(int fd, char *mode_arg, char *name, char *acc_path, bool recursive)
if(fchmodat(fd, name, mode, 0) != 0)
{
fprintf(stderr,
- "chmod: Failed setting permissions to 0%6o for '%s': %s\n",
+ "chmod: Failed setting permissions to 0%04o for '%s': %s\n",
mode,
acc_path,
strerror(errno));
@@ -58,7 +58,7 @@ do_fchmodat(int fd, char *mode_arg, char *name, char *acc_path, bool recursive)
char mode_to[11] = "";
symbolize_mode(mode, mode_to);
- printf("chmod: Permissions changed from 0%o6/%s to 0%o6/%s for '%s'\n",
+ printf("chmod: Permissions changed from 0%04o/%s to 0%04o/%s for '%s'\n",
stats.st_mode & 07777,
mode_from,
mode & 07777,
@@ -67,7 +67,7 @@ do_fchmodat(int fd, char *mode_arg, char *name, char *acc_path, bool recursive)
}
}
else if(opt_v)
- printf("chmod: Permissions already set to 0%o6/%s for '%s'\n",
+ printf("chmod: Permissions already set to 0%04o/%s for '%s'\n",
stats.st_mode & 07777,
mode_from,
acc_path);