summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorSami Kerola2019-02-09 10:34:52 +0100
committerKarel Zak2019-02-18 13:19:24 +0100
commit4813a5210f6fb979d8f7a592f71a2f9c4d3db179 (patch)
tree90f4aafc604b9a676c0f614281076d8ab52686da /disk-utils
parentcal: fix Sexit and Senter (diff)
downloadkernel-qcow2-util-linux-4813a5210f6fb979d8f7a592f71a2f9c4d3db179.tar.gz
kernel-qcow2-util-linux-4813a5210f6fb979d8f7a592f71a2f9c4d3db179.tar.xz
kernel-qcow2-util-linux-4813a5210f6fb979d8f7a592f71a2f9c4d3db179.zip
various: fix 'uninitialized when used' warnings [clang]
This change fixes "warning: variable 'var' may be uninitialized when used here [-Wconditional-uninitialized]" warnings reported in various files. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/mkfs.minix.c2
-rw-r--r--disk-utils/sfdisk.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 54c47da7e..8e6811f49 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -685,7 +685,7 @@ static int find_super_magic(const struct fs_control *ctl)
static void determine_device_blocks(struct fs_control *ctl, const struct stat *statbuf)
{
- unsigned long long dev_blocks;
+ unsigned long long dev_blocks = 0;
if (S_ISBLK(statbuf->st_mode)) {
int sectorsize;
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 52ccc5251..2427cef5b 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -1724,7 +1724,7 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
nparts = fdisk_table_get_nents(tb);
if (nparts) {
- size_t cur_partno;
+ size_t cur_partno = (size_t) -1;
struct fdisk_partition *pa = fdisk_table_get_partition(tb, nparts - 1);
assert(pa);