summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd_format.c2
-rw-r--r--libbcachefs.c2
-rw-r--r--tools-util.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/cmd_format.c b/cmd_format.c
index 3f96f5de..372ca8f8 100644
--- a/cmd_format.c
+++ b/cmd_format.c
@@ -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);
diff --git a/libbcachefs.c b/libbcachefs.c
index 34246dc9..d0c58da7 100644
--- a/libbcachefs.c
+++ b/libbcachefs.c
@@ -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);
}
diff --git a/tools-util.h b/tools-util.h
index 568707bc..de8010ee 100644
--- a/tools-util.h
+++ b/tools-util.h
@@ -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);