r15316: I don't understand quite why this function was ever like this, but we
[kai/samba.git] / source4 / lib / util / util_str.c
index 34d37ecfbdd7cf69e7cd0f90c243abb245230a0e..df9fd44cd6ba28eee8457e0d477bde86e65c1e80 100644 (file)
@@ -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;
        }
 }