Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-12-29 10:26:33 +0300
committerEric Andersen <andersen@codepoet.org>2001-12-29 10:26:33 +0300
commit79a466f1285509853b2fa37351219d58506c58c4 (patch)
tree30b68f0eee00c9cdde633ac35ab4ff6bfeade994 /libbb
parent6d13964714c36ef6ea8d698b64fd7caea77969f9 (diff)
optimize this a little bit.
Diffstat (limited to 'libbb')
-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 @@
#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;
}