projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d13964
)
optimize this a little bit.
author
Eric Andersen
<andersen@codepoet.org>
Sat, 29 Dec 2001 07:26:33 +0000
(07:26 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Sat, 29 Dec 2001 07:26:33 +0000
(07:26 -0000)
libbb/chomp.c
patch
|
blob
|
history
diff --git
a/libbb/chomp.c
b/libbb/chomp.c
index 94404a98d2df2e08cd9995cbed544c58abeff73f..e5a522f01df3665aa40217befb6e31bd87f38c98 100644
(file)
--- 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;
}