[virt-tools-list] [PATCH 1/2] remote-viewer: Fix build warning due to shadow declaration

Luiz Capitulino lcapitulino at redhat.com
Tue Sep 18 19:02:41 UTC 2012


From: Luiz Capitulino <lcapitulino at gmail.com>

remote-viewer-main.c: In function 'main':
remote-viewer-main.c:263:15: warning: declaration of 'basename' shadows a global declaration [-Wshadow]

Use 'path' instead of 'basename'.

Signed-off-by: Luiz Capitulino <lcapitulino at gmail.com>
---
 src/remote-viewer-main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c
index 615e758..f739d6b 100644
--- a/src/remote-viewer-main.c
+++ b/src/remote-viewer-main.c
@@ -260,11 +260,11 @@ main(int argc, char **argv)
 #endif
     g_option_context_parse (context, &argc, &argv, &error);
     if (error) {
-        char *basename;
-        basename = g_path_get_basename(argv[0]);
+        char *path;
+        path = g_path_get_basename(argv[0]);
         g_printerr(_("%s\nRun '%s --help' to see a full list of available command line options\n"),
-                   error->message, basename);
-        g_free(basename);
+                   error->message, path);
+        g_free(path);
         g_error_free(error);
         goto cleanup;
     }
-- 
1.7.12.315.g682ce8b




More information about the virt-tools-list mailing list