diff options
Diffstat (limited to 'xorg-server/os')
-rw-r--r-- | xorg-server/os/connection.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index 39f1dae87..73a37df49 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -1281,10 +1281,11 @@ MakeClientGrabPervious(ClientPtr client) void ListenOnOpenFD(int fd, int noxauth) { char port[256]; XtransConnInfo ciptr; + const char *display_env = getenv("DISPLAY"); - if(!strncmp(getenv("DISPLAY"), "/tmp/launch", 11)) { + if(display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) { /* Make the path the launchd socket if our DISPLAY is set right */ - strcpy(port, getenv("DISPLAY")); + strcpy(port, display_env); } else { /* Just some default so things don't break and die. */ sprintf(port, ":%d", atoi(display)); |