option: Remove shadowing opt decl from qemu_opt_print()
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 5 Oct 2017 19:07:25 +0000 (20:07 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 20 Dec 2017 08:11:50 +0000 (09:11 +0100)
opt was declared as a separate local inside the last loop,
shadowing the local at the top of the function.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20171005190725.18712-1-dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
util/qemu-option.c

index 9b1dc8093bc03ca5300685e61b982bd009dec590..877c5b4d67b1af04cc2ebe5539d4ad852665f1c0 100644 (file)
@@ -766,7 +766,7 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
     }
     for (; desc && desc->name; desc++) {
         const char *value;
-        QemuOpt *opt = qemu_opt_find(opts, desc->name);
+        opt = qemu_opt_find(opts, desc->name);
 
         value = opt ? opt->str : desc->def_value_str;
         if (!value) {