]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Fix format args to die()
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 15 Jun 2021 00:28:26 +0000 (20:28 -0400)
committerKent Overstreet <kent.overstreet@gmail.com>
Tue, 15 Jun 2021 00:28:26 +0000 (20:28 -0400)
Also, add the format attribute so we get warnings about this.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
cmd_format.c
libbcachefs.c
tools-util.h

index 3f96f5de3c221acb8cfafca33bd12acb0003aef8..372ca8f830d69537752c1740d9e28741de09225d 100644 (file)
@@ -258,7 +258,7 @@ int cmd_format(int argc, char *argv[])
                                                darray_size(device_paths),
                                                bch2_opts_empty());
                if (IS_ERR(c))
-                       die("error opening %s: %s", device_paths.item,
+                       die("error opening %s: %s", device_paths.item[0],
                            strerror(-PTR_ERR(c)));
 
                bch2_fs_stop(c);
index 34246dc9106d5ffd83712f4b6571b4e91e042abe..d0c58da7f5fd1088d34a368c2a4f109c6cffc240 100644 (file)
@@ -257,7 +257,7 @@ struct bch_sb *bch2_format(struct bch_opt_strs      fs_opt_strs,
 
                idx = bch2_disk_path_find_or_create(&sb, i->group);
                if (idx < 0)
-                       die("error creating disk path: %s", idx);
+                       die("error creating disk path: %s", i->group);
 
                SET_BCH_MEMBER_GROUP(m, idx + 1);
        }
index 568707bc2f54b9fe6ba4e82a07fab8a8f23eab11..de8010eead780e103d0c37a654ca558f52b84676 100644 (file)
@@ -22,7 +22,7 @@
 
 #define noreturn __attribute__((noreturn))
 
-void die(const char *, ...) noreturn;
+void die(const char *, ...) __attribute__((format(printf, 1, 2))) noreturn;
 char *mprintf(const char *, ...)
        __attribute__ ((format (printf, 1, 2)));
 void *xcalloc(size_t, size_t);