aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-12-29 07:26:33 +0000
committerEric Andersen <andersen@codepoet.org>2001-12-29 07:26:33 +0000
commit79a466f1285509853b2fa37351219d58506c58c4 (patch)
tree30b68f0eee00c9cdde633ac35ab4ff6bfeade994
parent6d13964714c36ef6ea8d698b64fd7caea77969f9 (diff)
downloadbusybox-w32-79a466f1285509853b2fa37351219d58506c58c4.tar.gz
busybox-w32-79a466f1285509853b2fa37351219d58506c58c4.tar.bz2
busybox-w32-79a466f1285509853b2fa37351219d58506c58c4.zip
optimize this a little bit.
-rw-r--r--libbb/chomp.c8
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
29void chomp(char *s) 28void 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