aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-24 16:46:13 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-24 16:46:13 +0000
commite94a87134d2c78d3a1df39605d1f30d928a592a5 (patch)
tree5fa9904a9b652246451bd6ac7cca1c94e424af0d /util-linux
parentff9234948eac3925b8881ab0f05402e95a339f0f (diff)
downloadbusybox-e94a87134d2c78d3a1df39605d1f30d928a592a5.tar.gz
mdev: fix counting of '%' in pattern
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mdev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index bf07aebb3..a32c04f6b 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -180,8 +180,9 @@ static void make_device(char *path, int delete)
/* substitute %1..9 with off[1..9], if any */
n = 0;
s = val;
- while (*s && *s++ == '%')
- n++;
+ while (*s)
+ if (*s++ == '%')
+ n++;
p = alias = xzalloc(strlen(val) + n * strlen(device_name));
s = val + 1;