From e94a87134d2c78d3a1df39605d1f30d928a592a5 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 24 May 2008 16:46:13 +0000 Subject: mdev: fix counting of '%' in pattern --- util-linux/mdev.c | 5 +++-- 1 file 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; -- cgit v1.2.3