aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mdev.c
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/mdev.c
parentff9234948eac3925b8881ab0f05402e95a339f0f (diff)
downloadbusybox-w32-e94a87134d2c78d3a1df39605d1f30d928a592a5.tar.gz
busybox-w32-e94a87134d2c78d3a1df39605d1f30d928a592a5.tar.bz2
busybox-w32-e94a87134d2c78d3a1df39605d1f30d928a592a5.zip
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 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)
180 /* substitute %1..9 with off[1..9], if any */ 180 /* substitute %1..9 with off[1..9], if any */
181 n = 0; 181 n = 0;
182 s = val; 182 s = val;
183 while (*s && *s++ == '%') 183 while (*s)
184 n++; 184 if (*s++ == '%')
185 n++;
185 186
186 p = alias = xzalloc(strlen(val) + n * strlen(device_name)); 187 p = alias = xzalloc(strlen(val) + n * strlen(device_name));
187 s = val + 1; 188 s = val + 1;