aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xserver/hw
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-13 12:47:48 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commitb99daadb05e14e85da6c5e905057e10fc27c0fcf (patch)
tree752e6fea3900b604d44ef6a498539e9a785bf22f /unix/xserver/hw
parente6c5b29f12780303299506fe04f089bc98b80c91 (diff)
downloadtigervnc-b99daadb05e14e85da6c5e905057e10fc27c0fcf.tar.gz
tigervnc-b99daadb05e14e85da6c5e905057e10fc27c0fcf.zip
Use std::string instead of CharArray
Let's use a more common type instead of something homegrown. Should be more familiar to new developers.
Diffstat (limited to 'unix/xserver/hw')
-rw-r--r--unix/xserver/hw/vnc/RFBGlue.cc1
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.cc8
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.h4
3 files changed, 7 insertions, 6 deletions
diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc
index 4f63397e..6bf745fc 100644
--- a/unix/xserver/hw/vnc/RFBGlue.cc
+++ b/unix/xserver/hw/vnc/RFBGlue.cc
@@ -28,6 +28,7 @@
#include <rfb/LogWriter.h>
#include <rfb/Logger_stdio.h>
#include <rfb/Logger_syslog.h>
+#include <rfb/util.h>
#include "RFBGlue.h"
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 14b111ae..b5a58671 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -172,10 +172,10 @@ void XserverDesktop::queryConnection(network::Socket* sock,
return;
}
- queryConnectAddress.replaceBuf(strDup(sock->getPeerAddress()));
+ queryConnectAddress = sock->getPeerAddress();
if (!userName)
userName = "(anonymous)";
- queryConnectUsername.replaceBuf(strDup(userName));
+ queryConnectUsername = userName;
queryConnectId = (uint32_t)(intptr_t)sock;
queryConnectSocket = sock;
@@ -428,8 +428,8 @@ void XserverDesktop::getQueryConnect(uint32_t* opaqueId,
*username = "";
*timeout = 0;
} else {
- *address = queryConnectAddress.buf;
- *username = queryConnectUsername.buf;
+ *address = queryConnectAddress.c_str();
+ *username = queryConnectUsername.c_str();
*timeout = queryConnectTimeout;
}
}
diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h
index 94f6f076..677097a6 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.h
+++ b/unix/xserver/hw/vnc/XserverDesktop.h
@@ -123,8 +123,8 @@ private:
uint32_t queryConnectId;
network::Socket* queryConnectSocket;
- rfb::CharArray queryConnectAddress;
- rfb::CharArray queryConnectUsername;
+ std::string queryConnectAddress;
+ std::string queryConnectUsername;
rfb::Timer queryConnectTimer;
OutputIdMap outputIdMap;