diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-29 19:22:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-29 19:22:13 +0000 |
commit | 5a28a25b9dd81e0975532458723c4244ff532e58 (patch) | |
tree | 53d30dbcfb05156500451389d47827487564b257 /libbb | |
parent | 63430ae35ad98d5946851e8a366379dd1574f2a2 (diff) | |
download | busybox-w32-5a28a25b9dd81e0975532458723c4244ff532e58.tar.gz busybox-w32-5a28a25b9dd81e0975532458723c4244ff532e58.tar.bz2 busybox-w32-5a28a25b9dd81e0975532458723c4244ff532e58.zip |
syscall: code shrink
text data bss dec hex filename
777209 974 9676 787859 c0593 busybox_old
777042 974 9676 787692 c04ec busybox_unstripped
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/trim.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libbb/trim.c b/libbb/trim.c index 4957d7276..94ccaf7ed 100644 --- a/libbb/trim.c +++ b/libbb/trim.c | |||
@@ -16,12 +16,16 @@ void trim(char *s) | |||
16 | size_t lws; | 16 | size_t lws; |
17 | 17 | ||
18 | /* trim trailing whitespace */ | 18 | /* trim trailing whitespace */ |
19 | while (len && isspace(s[len-1])) --len; | 19 | while (len && isspace(s[len-1])) |
20 | --len; | ||
20 | 21 | ||
21 | /* trim leading whitespace */ | 22 | /* trim leading whitespace */ |
22 | if (len) { | 23 | if (len) { |
23 | lws = strspn(s, " \n\r\t\v"); | 24 | lws = strspn(s, " \n\r\t\v"); |
24 | memmove(s, s + lws, len -= lws); | 25 | if (lws) { |
26 | len -= lws; | ||
27 | memmove(s, s + lws, len); | ||
28 | } | ||
25 | } | 29 | } |
26 | s[len] = '\0'; | 30 | s[len] = '\0'; |
27 | } | 31 | } |