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...
---
toys/pending/lsof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From 211aebb16381500f5fef072bd374e71912efd78d Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Tue, 6 Aug 2019 10:05:23 -0700
Subject: [PATCH] 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...
---
toys/pending/lsof.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.22.0.770.g0f2c4a37fd-goog
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net