summaryrefslogtreecommitdiff
path: root/libbb/trim.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-12 00:32:05 +0000
committerDenis Vlasenko2007-04-12 00:32:05 +0000
commit51742f4bb0c57a4d5063ece9437a2f34a42e52c8 (patch)
tree7a912fc65ff43bdb09078d75bfc02ad8f5380b47 /libbb/trim.c
parent50f7f446ecaadef6895a4ee601567e0b68330637 (diff)
downloadbusybox-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.zip
busybox-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.tar.gz
style fixes. No code changes
Diffstat (limited to 'libbb/trim.c')
-rw-r--r--libbb/trim.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libbb/trim.c b/libbb/trim.c
index d363915..4957d72 100644
--- a/libbb/trim.c
+++ b/libbb/trim.c
@@ -8,12 +8,8 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
#include "libbb.h"
-
void trim(char *s)
{
size_t len = strlen(s);
@@ -23,9 +19,9 @@ void trim(char *s)
while (len && isspace(s[len-1])) --len;
/* trim leading whitespace */
- if(len) {
+ if (len) {
lws = strspn(s, " \n\r\t\v");
memmove(s, s + lws, len -= lws);
}
- s[len] = 0;
+ s[len] = '\0';
}