declare real_display as const

This commit is contained in:
Julien Danjou 2007-12-17 12:26:09 +01:00
parent 395c0ba6d7
commit 3af4117039
1 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,8 @@
struct sockaddr_un * struct sockaddr_un *
get_client_addr(const char *display) get_client_addr(const char *display)
{ {
char *homedir, *tmp, *real_display = NULL; char *homedir, *tmp;
const char *real_display = NULL;
ssize_t path_len; ssize_t path_len;
struct sockaddr_un *addr; struct sockaddr_un *addr;
@ -42,7 +43,7 @@ get_client_addr(const char *display)
if((tmp = strchr(display, ':'))) if((tmp = strchr(display, ':')))
real_display = tmp + 1; real_display = tmp + 1;
else else
real_display = (char *) display; real_display = display;
if((tmp = strrchr(display, '.'))) if((tmp = strrchr(display, '.')))
*tmp = '\0'; *tmp = '\0';
} }