summaryrefslogtreecommitdiff
path: root/util-linux/losetup.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-09-29 21:47:11 +0000
committerDenis Vlasenko2006-09-29 21:47:11 +0000
commit0b193a787194549bbf22ff6f5db7a52f41da69ef (patch)
tree40c9022518937b186c9b2fa3820aea7c12f03ef2 /util-linux/losetup.c
parenta959588b80529ef5e02048ed71f3c7bf9a117217 (diff)
downloadbusybox-0b193a787194549bbf22ff6f5db7a52f41da69ef.zip
busybox-0b193a787194549bbf22ff6f5db7a52f41da69ef.tar.gz
losetup: use /dev/loopN or /dev/loop/N according to CONFIG_FEATURE_DEVFS=n/y
Diffstat (limited to 'util-linux/losetup.c')
-rw-r--r--util-linux/losetup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/losetup.c b/util-linux/losetup.c
index 6b9a810..54a1601 100644
--- a/util-linux/losetup.c
+++ b/util-linux/losetup.c
@@ -48,11 +48,11 @@ int losetup_main(int argc, char **argv)
printf("%s: %s\n", argv[0], s);
if (ENABLE_FEATURE_CLEAN_UP) free(s);
} else {
- char dev[11] = "/dev/loop0";
+ char dev[sizeof(LOOP_NAME"0")] = LOOP_NAME"0";
char c;
for (c = '0'; c <= '9'; ++c) {
char *s;
- dev[9] = c;
+ dev[sizeof(LOOP_NAME"0")-2] = c;
s = query_loop(dev);
if (s) {
printf("%s: %s\n", dev, s);