summaryrefslogtreecommitdiff
path: root/util-linux/mdev.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-24 16:46:13 +0000
committerDenis Vlasenko2008-05-24 16:46:13 +0000
commite94a87134d2c78d3a1df39605d1f30d928a592a5 (patch)
tree5fa9904a9b652246451bd6ac7cca1c94e424af0d /util-linux/mdev.c
parentff9234948eac3925b8881ab0f05402e95a339f0f (diff)
downloadbusybox-e94a87134d2c78d3a1df39605d1f30d928a592a5.zip
busybox-e94a87134d2c78d3a1df39605d1f30d928a592a5.tar.gz
mdev: fix counting of '%' in pattern
Diffstat (limited to 'util-linux/mdev.c')
-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 bf07aeb..a32c04f 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;