libbb: eliminate a static data array in bb_mode_string()
function old new delta
print_stat 861 869 +8
header_verbose_list_ar 73 77 +4
display_single 975 979 +4
header_verbose_list 237 239 +2
bb_mode_string 124 115 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 18/-9) Total: 9 bytes
text data bss dec hex filename
1043136 559 5052 1048747 1000ab busybox_old
1043153 559 5020 1048732 10009c busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 9e85616..9a1264e 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -503,7 +503,8 @@
column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1));
if (opt & OPT_l) {
/* long listing: show mode */
- column += printf("%-10s ", (char *) bb_mode_string(dn->dn_mode));
+ char modestr[12];
+ column += printf("%-10s ", (char *) bb_mode_string(modestr, dn->dn_mode));
/* long listing: show number of links */
column += printf("%4lu ", (long) dn->dn_nlink);
/* long listing: show user/group */