lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / util-linux / losetup.c
index 0f5914c88b28761bdba0dd38ab0b8ab6f02a0e56..776f784f5b1a51b7b34789fe0f68525af81dea2d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2002  Matt Kraai.
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
@@ -65,9 +65,9 @@ int losetup_main(int argc UNUSED_PARAM, char **argv)
        n = 0;
        while (1) {
                char *s;
-               char dev[sizeof(LOOP_NAME) + sizeof(int)*3];
+               char dev[LOOP_NAMESIZE];
 
-               sprintf(dev, LOOP_NAME"%u", n);
+               sprintf(dev, LOOP_FORMAT, n);
                s = query_loop(dev);
                n++;
                if (!s) {