]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: fix compiler warning [-Wmaybe-uninitialized]
authorKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 08:00:18 +0000 (10:00 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 08:00:18 +0000 (10:00 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index aa544f666dbefb5288faa942028fc3ab3a3b2f5d..4d34ca78c8acfff588242d52079ea2070fa8cbbe 100644 (file)
@@ -945,7 +945,7 @@ static ssize_t read_lba(struct fdisk_context *cxt, uint64_t lba,
 static unsigned char *gpt_read_entries(struct fdisk_context *cxt,
                                         struct gpt_header *header)
 {
-       size_t sz;
+       size_t sz = 0;
        ssize_t ssz;
 
        unsigned char *ret = NULL;
@@ -1971,7 +1971,7 @@ static int gpt_write_partitions(struct fdisk_context *cxt,
                                struct gpt_header *header, unsigned char *ents)
 {
        off_t offset = (off_t) le64_to_cpu(header->partition_entry_lba) * cxt->sector_size;
-       size_t towrite;
+       size_t towrite = 0;
        ssize_t ssz;
        int rc;