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:
@@ -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';
|
||||
}
|
||||
|
Reference in New Issue
Block a user