From 7c9e193ae57974a27af73f05115532f8d3887502 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Sun, 13 Nov 2011 09:27:53 +0100 Subject: Imported nxcomp-3.4.0-7.tar.gz Summary: Imported nxcomp-3.4.0-7.tar.gz Keywords: Imported nxcomp-3.4.0-7.tar.gz into Git repository --- nxcomp/Loop.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nxcomp/Loop.cpp') diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp index d5f5d0338..92b6fc28f 100644 --- a/nxcomp/Loop.cpp +++ b/nxcomp/Loop.cpp @@ -4261,6 +4261,13 @@ int SetupDisplaySocket(int &xServerAddrFamily, sockaddr *&xServerAddr, if (useLaunchdSocket == 1) { + char *slash = rindex(display, '/'); + + if (slash != NULL) + { + *slash = '\0'; + } + snprintf(unixSocketDir, DEFAULT_STRING_LENGTH - 1, "%s", display); } @@ -4301,7 +4308,7 @@ int SetupDisplaySocket(int &xServerAddrFamily, sockaddr *&xServerAddr, if (useLaunchdSocket == 1) { - sprintf(unixSocketName, "%s:%d", unixSocketDir, xPort); + strncpy(unixSocketName, displayHost, DEFAULT_STRING_LENGTH - 1); } #endif -- cgit v1.2.3