diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-12 00:32:05 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-12 00:32:05 +0000 |
commit | 51742f4bb0c57a4d5063ece9437a2f34a42e52c8 (patch) | |
tree | 7a912fc65ff43bdb09078d75bfc02ad8f5380b47 /libbb/trim.c | |
parent | 50f7f446ecaadef6895a4ee601567e0b68330637 (diff) | |
download | busybox-w32-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.tar.gz busybox-w32-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.tar.bz2 busybox-w32-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.zip |
style fixes. No code changes
Diffstat (limited to 'libbb/trim.c')
-rw-r--r-- | libbb/trim.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libbb/trim.c b/libbb/trim.c index d36391540..4957d7276 100644 --- a/libbb/trim.c +++ b/libbb/trim.c | |||
@@ -8,12 +8,8 @@ | |||
8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <stdio.h> | ||
12 | #include <string.h> | ||
13 | #include <ctype.h> | ||
14 | #include "libbb.h" | 11 | #include "libbb.h" |
15 | 12 | ||
16 | |||
17 | void trim(char *s) | 13 | void trim(char *s) |
18 | { | 14 | { |
19 | size_t len = strlen(s); | 15 | size_t len = strlen(s); |
@@ -23,9 +19,9 @@ void trim(char *s) | |||
23 | while (len && isspace(s[len-1])) --len; | 19 | while (len && isspace(s[len-1])) --len; |
24 | 20 | ||
25 | /* trim leading whitespace */ | 21 | /* trim leading whitespace */ |
26 | if(len) { | 22 | if (len) { |
27 | lws = strspn(s, " \n\r\t\v"); | 23 | lws = strspn(s, " \n\r\t\v"); |
28 | memmove(s, s + lws, len -= lws); | 24 | memmove(s, s + lws, len -= lws); |
29 | } | 25 | } |
30 | s[len] = 0; | 26 | s[len] = '\0'; |
31 | } | 27 | } |