From 4813a5210f6fb979d8f7a592f71a2f9c4d3db179 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 9 Feb 2019 09:34:52 +0000 Subject: 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 --- libfdisk/src/dos.c | 2 +- libfdisk/src/table.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libfdisk') 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); -- cgit v1.2.3-55-g7522