aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/Dialog.cxx
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/rfb_win32/Dialog.cxx
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/rfb_win32/Dialog.cxx')
-rw-r--r--win/rfb_win32/Dialog.cxx9
1 files changed, 4 insertions, 5 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++;