From 9dee6591905d39283046136ebe87529157757202 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Tue, 16 Feb 2016 09:38:12 +0100 Subject: [PATCH] ntfsrecover.c: Fix compiler warning about uninitialized 'savebuf' usage. The previous fix for the warning referred to 'prevbuf' being used uninitialized and this is also what the compiler says. However initializing 'prevbuf' doesn't make the warning go away and further testing revealed that it is really 'savebuf' being possibly used prior to initialization that is the source of the warning (the incorrect warning message is probably an optimization-related gcc bug). So replace previous ineffective fix with explicit initialization of 'savebuf'. --- ntfsprogs/ntfsrecover.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntfsprogs/ntfsrecover.c b/ntfsprogs/ntfsrecover.c index c2b6c4ee..aae96adf 100644 --- a/ntfsprogs/ntfsrecover.c +++ b/ntfsprogs/ntfsrecover.c @@ -1090,7 +1090,7 @@ static const struct BUFFER *findprevious(CONTEXT *ctx, const struct BUFFER *buf) error = FALSE; prevblk = buf->num; - prevbuf = (struct BUFFER*)NULL; + savebuf = (struct BUFFER*)NULL; skipped = 0; do { prevmiddle = FALSE;