sfdisk: fix compiler warnings about uninitialized variables

warning: 'str' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2014-10-15 22:19:28 +01:00 committed by Karel Zak
parent d07b223788
commit f0f2be20ed
1 changed files with 3 additions and 3 deletions

View File

@ -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);