diff options
-rw-r--r-- | libbb/loop.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/loop.c b/libbb/loop.c index 204fcc982..b69d9d961 100644 --- a/libbb/loop.c +++ b/libbb/loop.c | |||
@@ -104,7 +104,8 @@ int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offse | |||
104 | 104 | ||
105 | /* Find a loop device. */ | 105 | /* Find a loop device. */ |
106 | try = *device ? *device : dev; | 106 | try = *device ? *device : dev; |
107 | for (i = 0; rc && i < 256; i++) { | 107 | /* 1048575 is a max possible minor number in Linux circa 2010 */ |
108 | for (i = 0; rc && i < 1048576; i++) { | ||
108 | sprintf(dev, LOOP_FORMAT, i); | 109 | sprintf(dev, LOOP_FORMAT, i); |
109 | 110 | ||
110 | IF_FEATURE_MOUNT_LOOP_CREATE(errno = 0;) | 111 | IF_FEATURE_MOUNT_LOOP_CREATE(errno = 0;) |