From: Sami Kerola Date: Wed, 15 Oct 2014 21:19:28 +0000 (+0100) Subject: sfdisk: fix compiler warnings about uninitialized variables X-Git-Tag: v2.26-rc1~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0f2be20eda68f1aaceeed4df602940e03627ba1;p=thirdparty%2Futil-linux.git sfdisk: fix compiler warnings about uninitialized variables warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Sami Kerola --- diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index ad0e17e212..49369bd0e9 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -756,7 +756,7 @@ static int command_partuuid(struct sfdisk *sf, int argc, char **argv) /* print partition uuid */ if (!uuid) { - const char *str; + const char *str = NULL; if (fdisk_get_partition(sf->cxt, partno - 1, &pa) == 0) str = fdisk_partition_get_uuid(pa); @@ -811,7 +811,7 @@ static int command_partlabel(struct sfdisk *sf, int argc, char **argv) /* print partition name */ if (!name) { - const char *str; + const char *str = NULL; if (fdisk_get_partition(sf->cxt, partno - 1, &pa) == 0) str = fdisk_partition_get_name(pa); @@ -867,7 +867,7 @@ static int command_partattrs(struct sfdisk *sf, int argc, char **argv) /* print partition name */ if (!attrs) { - const char *str; + const char *str = NULL; if (fdisk_get_partition(sf->cxt, partno - 1, &pa) == 0) str = fdisk_partition_get_attrs(pa);