From 40dd609f93a65c381370384dfa0ee9f5ed0b9680 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 21 Sep 2017 16:16:22 +0200 Subject: misc-utils: initialize "ip" in docfdisk to NULL Technically it is initializied in the for loop right before being used. From the conditional above, we know that the for loop is executed at least once and the variable is always initialized, but gcc doesn't appear to perform the same reasoning. This patch adds an initialization of the variable for the sake of making the compiler happy. Signed-off-by: David Oberhollenzer --- misc-utils/docfdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc-utils') diff --git a/misc-utils/docfdisk.c b/misc-utils/docfdisk.c index c2b9150..486ce29 100644 --- a/misc-utils/docfdisk.c +++ b/misc-utils/docfdisk.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) int ret, i, mhblock, unitsize, block; unsigned int nblocks[4], npart; unsigned int totblocks; - struct INFTLPartition *ip; + struct INFTLPartition *ip = NULL; unsigned char *oobbuf; struct mtd_oob_buf oob; char line[20]; -- cgit v1.2.3