diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-09 18:16:40 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-09 18:16:40 +0200 |
commit | 02859aaeb29fb83167364291f1ce26b54c23803b (patch) | |
tree | 93a30e982b81e3bde6af8800bcd0c8f3f0080f52 /libbb/bb_askpass.c | |
parent | e52da5570eb93d6cb2950e55c48bd22edb5a9f18 (diff) | |
download | busybox-w32-02859aaeb29fb83167364291f1ce26b54c23803b.tar.gz busybox-w32-02859aaeb29fb83167364291f1ce26b54c23803b.tar.bz2 busybox-w32-02859aaeb29fb83167364291f1ce26b54c23803b.zip |
use auto_string() where appropriate to kill a few statics
Custom linker script 'busybox_ldscript' found, using it
function old new delta
static.str 4 - -4
static.passwd 4 0 -4
bb_ask 322 311 -11
ether_print 63 47 -16
UNSPEC_print 82 66 -16
INET_sprint 59 38 -21
INET6_sprint 54 30 -24
make_human_readable_str 292 235 -57
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/7 up/down: 0/-153) Total: -153 bytes
text data bss dec hex filename
939880 992 17480 958352 e9f90 busybox_old
939736 992 17456 958184 e9ee8 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/bb_askpass.c')
-rw-r--r-- | libbb/bb_askpass.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index 1927ba9e9..c2580b9eb 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c | |||
@@ -1,7 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * Ask for a password | 3 | * Ask for a password |
4 | * I use a static buffer in this function. Plan accordingly. | ||
5 | * | 4 | * |
6 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
7 | * | 6 | * |
@@ -23,8 +22,8 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) | |||
23 | { | 22 | { |
24 | /* Was static char[BIGNUM] */ | 23 | /* Was static char[BIGNUM] */ |
25 | enum { sizeof_passwd = 128 }; | 24 | enum { sizeof_passwd = 128 }; |
26 | static char *passwd; | ||
27 | 25 | ||
26 | char *passwd; | ||
28 | char *ret; | 27 | char *ret; |
29 | int i; | 28 | int i; |
30 | struct sigaction sa, oldsa; | 29 | struct sigaction sa, oldsa; |
@@ -62,8 +61,7 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) | |||
62 | alarm(timeout); | 61 | alarm(timeout); |
63 | } | 62 | } |
64 | 63 | ||
65 | if (!passwd) | 64 | passwd = auto_string(xmalloc(sizeof_passwd)); |
66 | passwd = xmalloc(sizeof_passwd); | ||
67 | ret = passwd; | 65 | ret = passwd; |
68 | i = 0; | 66 | i = 0; |
69 | while (1) { | 67 | while (1) { |