From: Martin Pitt Date: Thu, 21 Oct 2010 07:35:29 +0000 (+0200) Subject: Fix uninitialized variable in part-id X-Git-Tag: upstream/2.1.2~585 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd48c454f14b6063f8584631f04bf4528969a82b;p=platform%2Fupstream%2Fudisks2.git Fix uninitialized variable in part-id With gcc 4.5: part-id.c: In function ‘main’: part-id.c:186:9: error: ‘partition_number’ may be used uninitialized in this function This only affected the error path, where we would return an arbitrary value in get_part_table_device_file()'s out_partition_number (but return a failure result). No big deal, but let's initialize it for quiescing gcc. --- diff --git a/src/probers/part-id.c b/src/probers/part-id.c index 25d91f9..658e7d9 100644 --- a/src/probers/part-id.c +++ b/src/probers/part-id.c @@ -190,6 +190,7 @@ get_part_table_device_file (struct udev_device *given_device, devpath = NULL; offset = 0; + partition_number = 0; ret = NULL; partition_table_syspath = NULL; alignment_offset = 0;