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:
8a24a65
)
Added a sanity check to fix weird bug exposed when sourcing in commands from a
author
Mark Whitley
<markw@lineo.com>
Mon, 23 Apr 2001 17:04:41 +0000
(17:04 -0000)
committer
Mark Whitley
<markw@lineo.com>
Mon, 23 Apr 2001 17:04:41 +0000
(17:04 -0000)
file with lash. Based on report from Heinz Walter.
libbb/trim.c
patch
|
blob
|
history
diff --git
a/libbb/trim.c
b/libbb/trim.c
index 78cf235dd006cae01c326006d69e2d79e24f3e18..d3be62d9381dbf3a070b9f17a3f86edbc5492ea1 100644
(file)
--- a/
libbb/trim.c
+++ b/
libbb/trim.c
@@
-33,7
+33,11
@@
void trim(char *s)
{
- int len=strlen(s);
+ int len = strlen(s);
+
+ /* sanity check */
+ if (len == 0)
+ return;
/* trim trailing whitespace */
while ( len > 0 && isspace(s[len-1]))