From 683d0bc041e766e31febc211bce289f9d36dbafe Mon Sep 17 00:00:00 2001 From: Benjamin Robin Date: Wed, 6 May 2020 22:58:24 +0200 Subject: [PATCH] resize-fs: Use xsprintf instead of snprintf --- src/shared/resize-fs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/shared/resize-fs.c b/src/shared/resize-fs.c index 0abd289fecf..24a17a2ffef 100644 --- a/src/shared/resize-fs.c +++ b/src/shared/resize-fs.c @@ -41,7 +41,6 @@ int resize_fs(int fd, uint64_t sz, uint64_t *ret_size) { *ret_size = u * sfs.f_bsize; } else if (is_fs_type(&sfs, BTRFS_SUPER_MAGIC)) { - _unused_ int r; struct btrfs_ioctl_vol_args args = {}; /* 256M is the minimize size enforced by the btrfs kernel code when resizing (which is @@ -54,8 +53,7 @@ int resize_fs(int fd, uint64_t sz, uint64_t *ret_size) { sz -= sz % sfs.f_bsize; - r = snprintf(args.name, sizeof(args.name), "%" PRIu64, sz); - assert((size_t) r < sizeof(args.name)); + xsprintf(args.name, "%" PRIu64, sz); if (ioctl(fd, BTRFS_IOC_RESIZE, &args) < 0) return -errno; -- 2.47.3