diff options
Diffstat (limited to 'libbb/chomp.c')
-rw-r--r-- | libbb/chomp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libbb/chomp.c b/libbb/chomp.c index 94404a9..e5a522f 100644 --- a/libbb/chomp.c +++ b/libbb/chomp.c @@ -25,13 +25,11 @@ #include <string.h> #include "libbb.h" - void chomp(char *s) { - char *lc = last_char_is(s, '\n'); - - if(lc) - *lc = 0; + if (!(s && *s)) return; + while (*s && (*s != '\n')) s++; + *s = 0; } |