git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7b55e8
)
Never ignore valgrind messages :-). Don't reference before the start
author
Jeremy Allison
<jra@samba.org>
Fri, 19 Jul 2002 19:56:27 +0000
(19:56 +0000)
committer
Jeremy Allison
<jra@samba.org>
Fri, 19 Jul 2002 19:56:27 +0000
(19:56 +0000)
of a string....
Jeremy.
source/lib/util_str.c
patch
|
blob
|
history
diff --git
a/source/lib/util_str.c
b/source/lib/util_str.c
index 67d3b2108ed9f07688ae943ba1267bb47a47124d..1a2c2bef1f5a82c8215958301260311b917be451 100644
(file)
--- a/
source/lib/util_str.c
+++ b/
source/lib/util_str.c
@@
-299,7
+299,7
@@
BOOL trim_string(char *s,const char *front,const char *back)
}
if (back_len) {
- while (strncmp(s+len-back_len,back,back_len)==0) {
+ while (
(len >= back_len) &&
strncmp(s+len-back_len,back,back_len)==0) {
s[len-back_len]='\0';
len -= back_len;
ret=True;