summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-24 10:22:07 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-25 10:17:39 -0700
commit88e5e5af7a6af15a6d277565e317f8d768067de5 (patch)
treeadf267e3f0af2c0de1d838d299e0235f424a90a5
parentd0d9975f459fd098e5b2cdc75edf4a9ebab6afd6 (diff)
Declare some char * as const to fix gcc -Wwrite-strings warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--xhost.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xhost.c b/xhost.c
index 6495d9b..cf05d59 100644
--- a/xhost.c
+++ b/xhost.c
@@ -143,7 +143,7 @@ extern int getdomainname(char *name, size_t len);
#endif
static int change_host(Display *dpy, char *name, Bool add);
-static char *get_hostname(XHostAddress *ha);
+static const char *get_hostname(XHostAddress *ha);
static int local_xerror(Display *dpy, XErrorEvent *rep);
#ifdef RETSIGTYPE /* autoconf AC_TYPE_SIGNAL */
@@ -200,7 +200,7 @@ main(int argc, char *argv[])
{
register char *arg;
int i, nhosts = 0;
- char *hostname;
+ const char *hostname;
int nfailed = 0;
XHostAddress *list;
Bool enabled = False;
@@ -355,8 +355,8 @@ change_host(Display *dpy, char *name, Bool add)
struct nodeent *np;
static struct dn_naddr dnaddr;
#endif /* DNETCONN */
- static char *add_msg = "being added to access control list";
- static char *remove_msg = "being removed from access control list";
+ static const char *add_msg = "being added to access control list";
+ static const char *remove_msg = "being removed from access control list";
namelen = strlen(name);
if ((lname = (char *)malloc(namelen+1)) == NULL) {
@@ -733,7 +733,7 @@ change_host(Display *dpy, char *name, Bool add)
jmp_buf env;
#endif
-static char *
+static const char *
get_hostname(XHostAddress *ha)
{
#if (defined(TCPCONN) || defined(STREAMSCONN)) && \