From 5c1ac16776cd9f2a75e31086755e72186b3b3d41 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 13 Jan 2023 11:14:21 +0100 Subject: Return static char buffer from some methods This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage. --- unix/x0vncserver/XDesktop.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unix/x0vncserver/XDesktop.cxx') diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 0b6d7ef1..12169c76 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -327,9 +327,9 @@ void XDesktop::queryConnection(network::Socket* sock, queryConnectSock = sock; - CharArray address(sock->getPeerAddress()); delete queryConnectDialog; - queryConnectDialog = new QueryConnectDialog(dpy, address.buf, + queryConnectDialog = new QueryConnectDialog(dpy, + sock->getPeerAddress(), userName, queryConnectTimeout, this); -- cgit v1.2.3