diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-12-29 07:26:33 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-12-29 07:26:33 +0000 |
commit | 2f72007b51294d458f8661542b3d63aaa6ff3fd1 (patch) | |
tree | 30b68f0eee00c9cdde633ac35ab4ff6bfeade994 /libbb | |
parent | 4cfb9ec990bbf22709c5bc9c8477559eb3b47110 (diff) | |
download | busybox-w32-2f72007b51294d458f8661542b3d63aaa6ff3fd1.tar.gz busybox-w32-2f72007b51294d458f8661542b3d63aaa6ff3fd1.tar.bz2 busybox-w32-2f72007b51294d458f8661542b3d63aaa6ff3fd1.zip |
optimize this a little bit.
git-svn-id: svn://busybox.net/trunk/busybox@3964 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-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 94404a98d..e5a522f01 100644 --- a/libbb/chomp.c +++ b/libbb/chomp.c | |||
@@ -25,13 +25,11 @@ | |||
25 | #include <string.h> | 25 | #include <string.h> |
26 | #include "libbb.h" | 26 | #include "libbb.h" |
27 | 27 | ||
28 | |||
29 | void chomp(char *s) | 28 | void chomp(char *s) |
30 | { | 29 | { |
31 | char *lc = last_char_is(s, '\n'); | 30 | if (!(s && *s)) return; |
32 | 31 | while (*s && (*s != '\n')) s++; | |
33 | if(lc) | 32 | *s = 0; |
34 | *lc = 0; | ||
35 | } | 33 | } |
36 | 34 | ||
37 | 35 | ||