[PATCH:xhost] Fix const warning for FamilyLocalHost empty address string

Alan Coopersmith alan.coopersmith at oracle.com
Fri Jun 14 00:08:16 PDT 2013


xhost.c: In function ‘change_host’:
xhost.c:452:13: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xhost.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xhost.c b/xhost.c
index 576513a..a67d136 100644
--- a/xhost.c
+++ b/xhost.c
@@ -448,8 +448,9 @@ change_host(Display *dpy, char *name, Bool add)
     }
 #endif
     if (family == FamilyLocalHost) {
+	char empty[] = "";
 	ha.length = 0;
-	ha.address = "";
+	ha.address = empty;
 	ha.family = family;
 	if (add)
 	    XAddHost(dpy, &ha);
-- 
1.7.9.2



More information about the xorg-devel mailing list