[virt-tools-list] [virt-viewer] g_getenv returns a const string

Christophe Fergeau cfergeau at redhat.com
Fri Apr 27 13:21:09 UTC 2012


When switching from getenv to g_getenv, 'doms' declaration
wasn't changed from char * to const char *, which causes
a gcc warning.
---
 src/virt-viewer-app.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 175282c..46af0f8 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -174,7 +174,7 @@ virt_viewer_app_set_debug(gboolean debug)
 {
 #if GLIB_CHECK_VERSION(2, 31, 0)
     if (debug) {
-        gchar *doms = g_getenv("G_MESSAGES_DEBUG");
+        const gchar *doms = g_getenv("G_MESSAGES_DEBUG");
         if (!doms) {
             g_setenv("G_MESSAGES_DEBUG", G_LOG_DOMAIN, 1);
         } else if (!strstr(doms, G_LOG_DOMAIN)) {
-- 
1.7.10




More information about the virt-tools-list mailing list