aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-08-06 10:05:23 -0700
committerRob Landley <rob@landley.net>2019-08-09 20:34:08 -0500
commit5fbdad94ac145c59308200d689eea40e79a7ec5e (patch)
tree328a38f2bafcd4120de614480ede5a9f75ebfd5d
parenta626662bf5abf198ef5c4dfe9c783416169242fd (diff)
downloadtoybox-5fbdad94ac145c59308200d689eea40e79a7ec5e.tar.gz
lsof: simplify octal mode display.
Since this masks, it doesn't actually have the same bug as e5942a8c90c2f52550496fdf08efddb564d8e5a3, but we may as well fix the other example of that questionable idiom while we're thinking about it...
-rw-r--r--toys/pending/lsof.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/pending/lsof.c b/toys/pending/lsof.c
index 2852f41f..5ab3af90 100644
--- a/toys/pending/lsof.c
+++ b/toys/pending/lsof.c
@@ -261,7 +261,7 @@ static void fill_stat(struct file_info *fi, const char *path)
case S_IFREG: strcpy(fi->type, "REG"); break;
case S_IFSOCK: strcpy(fi->type, "sock"); break;
default:
- snprintf(fi->type, sizeof(fi->type), "0%03o", sb.st_mode & S_IFMT);
+ snprintf(fi->type, sizeof(fi->type), "%04o", sb.st_mode & S_IFMT);
break;
}