From: Eric Andersen Date: Sat, 29 Dec 2001 07:26:33 +0000 (-0000) Subject: optimize this a little bit. X-Git-Tag: 0_60_3~143 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=79a466f1285509853b2fa37351219d58506c58c4;p=oweals%2Fbusybox.git optimize this a little bit. --- diff --git a/libbb/chomp.c b/libbb/chomp.c index 94404a98d..e5a522f01 100644 --- a/libbb/chomp.c +++ b/libbb/chomp.c @@ -25,13 +25,11 @@ #include #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; }