]> git.neil.brown.name Git - wiggle.git/commitdiff
vpatch: avoid warning from gcc-4.4.6
authorNeilBrown <neilb@suse.de>
Tue, 27 Aug 2013 23:38:33 +0000 (09:38 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 27 Aug 2013 23:38:33 +0000 (09:38 +1000)
It seems that gcc-4.4.6 doesn't like

   struct plist p = {0};

as it don't initialise all fields.
I only added that to make sure 'outfile' was initialised, so
just do that explicitly.

Reported-by: Stephen Cameron @ G+
Signed-off-by: NeilBrown <neilb@suse.de>
vpatch.c

index 2ec31d56ed370b70eed325368890468cc6d1d249..80b94a3cdc596a3cdc62fa7caf68adb97fe3a325 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -2350,8 +2350,7 @@ static int show_merge(char *origname, FILE *patch, int reverse,
        struct plist p = {0};
 
        p.file = origname;
-       if (replace)
-               p.outfile = outfile;
+       p.outfile = replace ? outfile : NULL;
        if (patch) {
                p.start = 0;
                fseek(patch, 0, SEEK_END);