From b4246a73537258bedbec63e37cb120a7d7ebafa8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 29 Apr 2006 09:11:07 +0000 Subject: r15316: I don't understand quite why this function was ever like this, but we need to replace every instance of the character. Previously we skipped the first. Andrew Bartlett (This used to be commit 5b58ab98d6b47b7cfd47eb5f7d38dc3724e44ca2) --- source4/lib/util/util_str.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/lib/util/util_str.c b/source4/lib/util/util_str.c index 34d37ecfbd..df9fd44cd6 100644 --- a/source4/lib/util/util_str.c +++ b/source4/lib/util/util_str.c @@ -775,8 +775,7 @@ _PUBLIC_ int strwicmp(const char *psz1, const char *psz2) **/ _PUBLIC_ void string_replace(char *s, char oldc, char newc) { - while (*s) { - s++; + for (;s && *s; s++) { if (*s == oldc) *s = newc; } } -- cgit