From e5942a8c90c2f52550496fdf08efddb564d8e5a3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 3 Aug 2019 21:36:06 -0500 Subject: Fix a bug report from E5ten: stat of a file with suid or sticky bit set output 5 digits of octal stat data instead of 4, due to hardwired leading 0 instead of %04a sprintf prefix. --- toys/other/stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys') diff --git a/toys/other/stat.c b/toys/other/stat.c index 66c5dc3b..d99331b7 100644 --- a/toys/other/stat.c +++ b/toys/other/stat.c @@ -193,7 +193,7 @@ void stat_main(void) "Inodes: Total: %c\tFree: %d" : " File: %N\n Size: %s\t Blocks: %b\t IO Blocks: %B\t %F\n" "Device: %Dh/%dd\t Inode: %i\t Links: %h\t Device type: %t,%T\n" - "Access: (0%a/%A)\tUid: (%5u/%8U)\tGid: (%5g/%8G)\n" + "Access: (%04a/%A)\tUid: (%5u/%8U)\tGid: (%5g/%8G)\n" "Access: %x\nModify: %y\nChange: %z"; if (FLAG(c)) format = TT.c; -- cgit v1.2.3