From: Gustavo Sverzut Barbieri Date: Sat, 10 Dec 2011 21:45:37 +0000 (-0200) Subject: fix string replace. X-Git-Tag: v1~55^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf8cf1483f6784f06fd28b084253f3fc5406e24c;p=thirdparty%2Fkmod.git fix string replace. configure files with this would fail: options wl x=1 were being handled as " =1". --- diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c index 2e58c91e..9a68a3e2 100644 --- a/libkmod/libkmod-util.c +++ b/libkmod/libkmod-util.c @@ -208,10 +208,9 @@ int read_str_ulong(int fd, unsigned long *value, int base) { char *strchr_replace(char *s, int c, char r) { char *p; - - for (p = s; p != NULL; p = strchr(p, c)) - *p = r; - + for (p = s; *p != '\0'; p++) + if (*p == c) + *p = r; return s; }