syscall: code shrink

text    data     bss     dec     hex filename
 777209     974    9676  787859   c0593 busybox_old
 777042     974    9676  787692   c04ec busybox_unstripped
This commit is contained in:
Denis Vlasenko
2007-10-29 19:22:13 +00:00
parent 63430ae35a
commit 5a28a25b9d
2 changed files with 93 additions and 102 deletions

View File

@@ -16,12 +16,16 @@ void trim(char *s)
size_t lws;
/* trim trailing whitespace */
while (len && isspace(s[len-1])) --len;
while (len && isspace(s[len-1]))
--len;
/* trim leading whitespace */
if (len) {
lws = strspn(s, " \n\r\t\v");
memmove(s, s + lws, len -= lws);
if (lws) {
len -= lws;
memmove(s, s + lws, len);
}
}
s[len] = '\0';
}