diff options
author | Sami Kerola | 2019-02-09 10:34:52 +0100 |
---|---|---|
committer | Karel Zak | 2019-02-18 13:19:24 +0100 |
commit | 4813a5210f6fb979d8f7a592f71a2f9c4d3db179 (patch) | |
tree | 90f4aafc604b9a676c0f614281076d8ab52686da /libfdisk | |
parent | cal: fix Sexit and Senter (diff) | |
download | kernel-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 'libfdisk')
-rw-r--r-- | libfdisk/src/dos.c | 2 | ||||
-rw-r--r-- | libfdisk/src/table.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c index 2e46aca70..8e9678da3 100644 --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@ -1708,7 +1708,7 @@ static int dos_add_partition(struct fdisk_context *cxt, } else { char hint[BUFSIZ]; struct fdisk_ask *ask; - int c; + int c = 0; /* the default layout for scripts is to create primary partitions */ if (cxt->script || !fdisk_has_dialogs(cxt)) { diff --git a/libfdisk/src/table.c b/libfdisk/src/table.c index 99a669ca2..1f9d5a28a 100644 --- a/libfdisk/src/table.c +++ b/libfdisk/src/table.c @@ -728,7 +728,7 @@ int fdisk_diff_tables(struct fdisk_table *a, struct fdisk_table *b, struct fdisk_iter *itr, struct fdisk_partition **res, int *change) { - struct fdisk_partition *pa, *pb; + struct fdisk_partition *pa = NULL, *pb; int rc = 1; assert(itr); |