svn commit: samba r15316 - in branches/SAMBA_4_0/source/lib/util: .

abartlet at samba.org abartlet at samba.org
Sat Apr 29 09:11:08 GMT 2006


Author: abartlet
Date: 2006-04-29 09:11:07 +0000 (Sat, 29 Apr 2006)
New Revision: 15316

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15316

Log:
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

Modified:
   branches/SAMBA_4_0/source/lib/util/util_str.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/util_str.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/util_str.c	2006-04-29 07:21:17 UTC (rev 15315)
+++ branches/SAMBA_4_0/source/lib/util/util_str.c	2006-04-29 09:11:07 UTC (rev 15316)
@@ -775,8 +775,7 @@
 **/
 _PUBLIC_ void string_replace(char *s, char oldc, char newc)
 {
-	while (*s) {
-		s++;
+	for (;s && *s; s++) {
 		if (*s == oldc) *s = newc;
 	}
 }



More information about the samba-cvs mailing list