aboutsummaryrefslogtreecommitdiff
path: root/libkmod
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2011-12-10 19:45:37 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2011-12-11 20:58:21 -0200
commitbf8cf1483f6784f06fd28b084253f3fc5406e24c (patch)
treefe620ee3d0a397c954e7943e15dd63c8e7553656 /libkmod
parent54ba8b341657f7b3981bc443899e4386ba34d802 (diff)
downloadkmod-bf8cf1483f6784f06fd28b084253f3fc5406e24c.tar.gz
fix string replace.
configure files with this would fail: options wl x=1 were being handled as " =1".
Diffstat (limited to 'libkmod')
-rw-r--r--libkmod/libkmod-util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
index 2e58c91..9a68a3e 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;
}