aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utility.c b/utility.c
index b4893a0e1..092cfdb10 100644
--- a/utility.c
+++ b/utility.c
@@ -1831,13 +1831,13 @@ void chomp(char *s)
1831#if defined(BB_SH) 1831#if defined(BB_SH)
1832void trim(char *s) 1832void trim(char *s)
1833{ 1833{
1834 /* trim trailing whitespace */
1835 while (isspace(s[strlen(s)-1]))
1836 s[strlen(s)-1]='\0';
1837
1834 /* trim leading whitespace */ 1838 /* trim leading whitespace */
1835 memmove(s, &s[strspn(s, " \n\r\t\v")], strlen(s)); 1839 memmove(s, &s[strspn(s, " \n\r\t\v")], strlen(s));
1836 1840
1837 /* trim trailing whitespace */
1838 while (*s && (!isspace (*s)))
1839 s++;
1840 *s='\0';
1841} 1841}
1842#endif 1842#endif
1843 1843