[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 2000cbc] Fix gcc 3 warning about uninitialized va

From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 2000cbc] Fix gcc 3 warning about uninitialized variable
Date: Sat, 29 Aug 2009 13:39:38 -0000

From: Blue Swirl <address@hidden>

If nb_sectors is 0, cluster_offset will not be initialized.

Signed-off-by: Blue Swirl <address@hidden>

diff --git a/block/qcow2.c b/block/qcow2.c
index a9c39bd..9637f2e 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -642,7 +642,7 @@ static int get_bits_from_size(size_t size)
 static int preallocate(BlockDriverState *bs)
     BDRVQcowState *s = bs->opaque;
-    uint64_t cluster_offset;
+    uint64_t cluster_offset = 0;
     uint64_t nb_sectors;
     uint64_t offset;
     int num;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]