aboutsummaryrefslogtreecommitdiff
path: root/libbb/trim.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-04-12 00:32:05 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-04-12 00:32:05 +0000
commit51742f4bb0c57a4d5063ece9437a2f34a42e52c8 (patch)
tree7a912fc65ff43bdb09078d75bfc02ad8f5380b47 /libbb/trim.c
parent50f7f446ecaadef6895a4ee601567e0b68330637 (diff)
downloadbusybox-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.tar.gz
busybox-51742f4bb0c57a4d5063ece9437a2f34a42e52c8.tar.bz2
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 d36391540..4957d7276 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';
}