diff mbox

[9/9] mkfs.btrfs: fix error text in '-r' mode

Message ID 1306790348-9553-10-git-send-email-slyfox@gentoo.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sergei Trofimovich May 30, 2011, 9:19 p.m. UTC
Smart gcc noticed use of uninitialized warning when compiled
with -O0 flags:

    mkfs.c:1291: error: 'file' may be used uninitialized in this function

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 mkfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/mkfs.c b/mkfs.c
index 73c898b..ef0407f 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1286,13 +1286,13 @@  int main(int ac, char **av)
 			block_count = dev_block_count;
 	} else {
 		ac = 0;
+		file = output;
 		fd = open_target(output);
 		if (fd < 0) {
 			fprintf(stderr, "unable to open the %s\n", file);
 			exit(1);
 		}
 
-		file = output;
 		first_fd = fd;
 		first_file = file;
 		block_count = size_sourcedir(source_dir, sectorsize,