summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2007-07-02 15:30:27 +0200
committerKarel Zak <kzak@redhat.com>2007-07-02 15:30:27 +0200
commitf27bec298fd8c5dcb2ecdafa18c8087f536c1d35 (patch)
treef787452f8fd763399c93df08c37e4749c9b4d269
parent3a9215ddc45e85b44d3b8bb0fe8cd3abe9e3e71c (diff)
downloadutil-linux-old-f27bec298fd8c5dcb2ecdafa18c8087f536c1d35.tar.gz
sfdisk: fix "may be used uninitialized" compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--fdisk/sfdisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index baacc077..29f66cc6 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -974,12 +974,12 @@ static struct geometry
get_fdisk_geometry_one(struct part_desc *p) {
struct geometry G;
+ memset(&G, 0, sizeof(struct geometry));
chs b = p->p.end_chs;
longchs bb = chs_to_longchs(b);
G.heads = bb.h+1;
G.sectors = bb.s;
G.cylindersize = G.heads*G.sectors;
- G.cylinders = G.start = 0;
return G;
}
@@ -989,8 +989,8 @@ get_fdisk_geometry(struct disk_desc *z) {
int pno, agree;
struct geometry G0, G;
+ memset(&G0, 0, sizeof(struct geometry));
agree = 0;
- G0.heads = G0.sectors = 0;
for (pno=0; pno < z->partno; pno++) {
p = &(z->partitions[pno]);
if (p->size != 0 && p->p.sys_type != 0) {