aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/RegConfig.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-10 14:30:37 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commit337dbc392253af92b0577da062a5abc1d032b1ef (patch)
treee540dc7dc861f575d841970561651a9fac506120 /win/rfb_win32/RegConfig.cxx
parentdde95fccca9fffff0da2dc486d639b162115bb9e (diff)
downloadtigervnc-337dbc392253af92b0577da062a5abc1d032b1ef.tar.gz
tigervnc-337dbc392253af92b0577da062a5abc1d032b1ef.zip
Return std::string instead of dynamic allocations
We mostly use classical C strings, but the memory management around them can get confusing and error prone. Let's use std::string for the cases where we need to return a newly allocated string.
Diffstat (limited to 'win/rfb_win32/RegConfig.cxx')
-rw-r--r--win/rfb_win32/RegConfig.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx
index 73a9e699..38ca52f9 100644
--- a/win/rfb_win32/RegConfig.cxx
+++ b/win/rfb_win32/RegConfig.cxx
@@ -26,7 +26,6 @@
#include <rfb_win32/RegConfig.h>
#include <rfb/LogWriter.h>
-#include <rfb/util.h>
//#include <rdr/HexOutStream.h>
using namespace rfb;
@@ -63,8 +62,8 @@ void RegConfig::loadRegistryConfig(RegKey& key) {
while (1) {
const char *name = key.getValueName(i++);
if (!name) break;
- CharArray value(key.getRepresentation(name));
- if (!value.buf || !Configuration::setParam(name, value.buf))
+ std::string value = key.getRepresentation(name);
+ if (!Configuration::setParam(name, value.c_str()))
vlog.info("unable to process %s", name);
}
} catch (rdr::SystemException& e) {