summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko2009-01-12 07:57:52 +0000
committerDenis Vlasenko2009-01-12 07:57:52 +0000
commit319fe129a15278193625eeb05752511d576c5588 (patch)
tree4587f23bff0fa8e5604a411f038dec5b7436b9a5 /util-linux
parentf0dc2c1d5c01cffd2e60c964df95a3bdecffe141 (diff)
downloadbusybox-319fe129a15278193625eeb05752511d576c5588.zip
busybox-319fe129a15278193625eeb05752511d576c5588.tar.gz
mdev: fix breakage caused by unified parser usage
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 9ad1a6f..0460aa7 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -179,8 +179,9 @@ static void make_device(char *path, int delete)
unsigned i, n;
#endif
char *a = val;
- s = strchr(val, ' ');
- val = (s && s[1]) ? s+1 : NULL;
+ s = strchrnul(val, ' ');
+ val = (s[0] && s[1]) ? s+1 : NULL;
+ s[0] = '\0';
#if ENABLE_FEATURE_MDEV_RENAME_REGEXP
/* substitute %1..9 with off[1..9], if any */
n = 0;