summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2021-09-17 01:13:58 +0200
committerDenys Vlasenko2021-09-17 01:18:31 +0200
commit59ac467dc6429a48522ef7fbe40fcd819563e49a (patch)
tree4b6af971b0ffc516294ff35ba7b5c1e99c6eadae /libbb
parent4958c18134eb7ad169cdaf22a9ad957ad4f4858c (diff)
downloadbusybox-59ac467dc6429a48522ef7fbe40fcd819563e49a.zip
busybox-59ac467dc6429a48522ef7fbe40fcd819563e49a.tar.gz
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>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/mode_string.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libbb/mode_string.c b/libbb/mode_string.c
index 9a286f3..2b82901 100644
--- a/libbb/mode_string.c
+++ b/libbb/mode_string.c
@@ -43,9 +43,8 @@ static const char type_chars[16] ALIGN1 = "?pc?d?b?-?l?s???";
/***************************************** 0123456789abcdef */
static const char mode_chars[7] ALIGN1 = "rwxSTst";
-const char* FAST_FUNC bb_mode_string(mode_t mode)
+char* FAST_FUNC bb_mode_string(char buf[12], mode_t mode)
{
- static char buf[12];
char *p = buf;
int i, j, k;
@@ -83,9 +82,8 @@ static const char type_chars[16] ALIGN1 = "?pc?d?b?-?l?s???";
/********************************** 0123456789abcdef */
static const char mode_chars[7] ALIGN1 = "rwxSTst";
-const char* FAST_FUNC bb_mode_string(mode_t mode)
+char* FAST_FUNC bb_mode_string(char buf[12], mode_t mode)
{
- static char buf[12];
char *p = buf;
int i, j, k, m;