aboutsummaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-17 16:49:01 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commit7f20bff3561dd942a39ce3ecf604c7c9673bad37 (patch)
tree3cae1d8cbd0938a595740882c6c2c95572dc5477 /win
parent741300728a889b4ccaec35bd57efb072018c860c (diff)
downloadtigervnc-7f20bff3561dd942a39ce3ecf604c7c9673bad37.tar.gz
tigervnc-7f20bff3561dd942a39ce3ecf604c7c9673bad37.zip
Remove unneeded CharArray:s
Avoid complicating things by moving things in to a second buffer here as there is no need for it.
Diffstat (limited to 'win')
-rw-r--r--win/rfb_win32/Dialog.cxx9
-rw-r--r--win/rfb_win32/RegConfig.cxx10
2 files changed, 9 insertions, 10 deletions
diff --git a/win/rfb_win32/Dialog.cxx b/win/rfb_win32/Dialog.cxx
index cb480506..ecba9747 100644
--- a/win/rfb_win32/Dialog.cxx
+++ b/win/rfb_win32/Dialog.cxx
@@ -300,13 +300,12 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo
char title[128];
if (!GetWindowText(PropSheet_GetCurrentPageHwnd(handle), title, sizeof(title)))
sprintf(title, "capture%d", i);
- CharArray pageTitle(strDup(title));
- for (int j=0; j<strlen(pageTitle.buf); j++) {
- if (pageTitle.buf[j] == '/' || pageTitle.buf[j] == '\\' || pageTitle.buf[j] == ':')
- pageTitle.buf[j] = '-';
+ for (int j=0; j<strlen(title); j++) {
+ if (title == '/' || title[j] == '\\' || title[j] == ':')
+ title[j] = '-';
}
char filename[256];
- sprintf(filename, "%s\\%s.bmp", tmpdir, pageTitle.buf);
+ sprintf(filename, "%s\\%s.bmp", tmpdir, title);
vlog.debug("writing to %s", filename);
saveBMP(filename, &fb);
i++;
diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx
index 3d5af9e3..73a9e699 100644
--- a/win/rfb_win32/RegConfig.cxx
+++ b/win/rfb_win32/RegConfig.cxx
@@ -61,11 +61,11 @@ void RegConfig::loadRegistryConfig(RegKey& key) {
DWORD i = 0;
try {
while (1) {
- CharArray name(strDup(key.getValueName(i++)));
- if (!name.buf) break;
- CharArray value(key.getRepresentation(name.buf));
- if (!value.buf || !Configuration::setParam(name.buf, value.buf))
- vlog.info("unable to process %s", name.buf);
+ const char *name = key.getValueName(i++);
+ if (!name) break;
+ CharArray value(key.getRepresentation(name));
+ if (!value.buf || !Configuration::setParam(name, value.buf))
+ vlog.info("unable to process %s", name);
}
} catch (rdr::SystemException& e) {
if (e.err != 6)