summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/rfb_win32/MsgBox.h2
-rw-r--r--win/rfb_win32/RegConfig.cxx4
-rw-r--r--win/rfb_win32/Registry.cxx8
-rw-r--r--win/rfb_win32/SDisplay.cxx2
-rw-r--r--win/rfb_win32/Service.cxx2
-rw-r--r--win/rfb_win32/Win32Util.cxx2
-rw-r--r--win/vncviewer/CConnOptions.cxx2
-rw-r--r--win/vncviewer/CConnThread.cxx2
-rw-r--r--win/vncviewer/MRU.h10
9 files changed, 17 insertions, 17 deletions
diff --git a/win/rfb_win32/MsgBox.h b/win/rfb_win32/MsgBox.h
index 59571395..918a909f 100644
--- a/win/rfb_win32/MsgBox.h
+++ b/win/rfb_win32/MsgBox.h
@@ -48,7 +48,7 @@ namespace rfb {
flags |= MB_TOPMOST | MB_SETFOREGROUND;
int len = _tcslen(AppName.buf) + 1;
if (msgType) len += _tcslen(msgType) + 3;
- TCharArray title = new TCHAR[len];
+ TCharArray title(new TCHAR[len]);
_tcscpy(title.buf, AppName.buf);
if (msgType) {
_tcscat(title.buf, _T(" : "));
diff --git a/win/rfb_win32/RegConfig.cxx b/win/rfb_win32/RegConfig.cxx
index dd1c3b06..ff944518 100644
--- a/win/rfb_win32/RegConfig.cxx
+++ b/win/rfb_win32/RegConfig.cxx
@@ -57,9 +57,9 @@ void RegConfig::loadRegistryConfig(RegKey& key) {
DWORD i = 0;
try {
while (1) {
- TCharArray name = tstrDup(key.getValueName(i++));
+ TCharArray name(tstrDup(key.getValueName(i++)));
if (!name.buf) break;
- TCharArray value = key.getRepresentation(name.buf);
+ TCharArray value(key.getRepresentation(name.buf));
if (!value.buf || !Configuration::setParam(CStr(name.buf), CStr(value.buf)))
vlog.info("unable to process %s", CStr(name.buf));
}
diff --git a/win/rfb_win32/Registry.cxx b/win/rfb_win32/Registry.cxx
index 1a828edf..4f073f47 100644
--- a/win/rfb_win32/Registry.cxx
+++ b/win/rfb_win32/Registry.cxx
@@ -175,7 +175,7 @@ TCHAR* RegKey::getString(const TCHAR* valname, const TCHAR* def) const {
}
void RegKey::getBinary(const TCHAR* valname, void** data, int* length) const {
- TCharArray hex = getRepresentation(valname);
+ TCharArray hex(getRepresentation(valname));
if (!rdr::HexInStream::hexStrToBin(CStr(hex.buf), (char**)data, length))
throw rdr::Exception("getBinary failed");
}
@@ -193,7 +193,7 @@ void RegKey::getBinary(const TCHAR* valname, void** data, int* length, void* def
}
int RegKey::getInt(const TCHAR* valname) const {
- TCharArray tmp = getRepresentation(valname);
+ TCharArray tmp(getRepresentation(valname));
return _ttoi(tmp.buf);
}
int RegKey::getInt(const TCHAR* valname, int def) const {
@@ -234,7 +234,7 @@ TCHAR* RegKey::getRepresentation(const TCHAR* valname) const {
switch (type) {
case REG_BINARY:
{
- TCharArray hex = rdr::HexOutStream::binToHexStr(data.buf, length);
+ TCharArray hex(rdr::HexOutStream::binToHexStr(data.buf, length));
return hex.takeBuf();
}
case REG_SZ:
@@ -272,7 +272,7 @@ TCHAR* RegKey::getRepresentation(const TCHAR* valname) const {
bool RegKey::isValue(const TCHAR* valname) const {
try {
- TCharArray tmp = getRepresentation(valname);
+ TCharArray tmp(getRepresentation(valname));
return true;
} catch(rdr::Exception) {
return false;
diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx
index 0af50649..f14b49f1 100644
--- a/win/rfb_win32/SDisplay.cxx
+++ b/win/rfb_win32/SDisplay.cxx
@@ -118,7 +118,7 @@ void SDisplay::stop()
// If we successfully start()ed then perform the DisconnectAction
if (core) {
CurrentUserToken cut;
- CharArray action = disconnectAction.getData();
+ CharArray action(disconnectAction.getData());
if (stricmp(action.buf, "Logoff") == 0) {
if (!cut.h)
vlog.info("ignoring DisconnectAction=Logoff - no current user");
diff --git a/win/rfb_win32/Service.cxx b/win/rfb_win32/Service.cxx
index 2b11a22d..a24b651c 100644
--- a/win/rfb_win32/Service.cxx
+++ b/win/rfb_win32/Service.cxx
@@ -534,7 +534,7 @@ bool rfb::win32::startService(const TCHAR* name) {
services.openKey(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\RunServices"));
// - Read the command-line from it
- TCharArray cmdLine = services.getString(name);
+ TCharArray cmdLine(services.getString(name));
// - Start the service
PROCESS_INFORMATION proc_info;
diff --git a/win/rfb_win32/Win32Util.cxx b/win/rfb_win32/Win32Util.cxx
index 2e17100c..5c283dfa 100644
--- a/win/rfb_win32/Win32Util.cxx
+++ b/win/rfb_win32/Win32Util.cxx
@@ -63,7 +63,7 @@ const TCHAR* FileVersionInfo::getVerString(const TCHAR* name, DWORD langId) {
langId = langId >> 8;
}
- TCharArray langIdStr = rdr::HexOutStream::binToHexStr(langIdBuf, sizeof(langId));
+ TCharArray langIdStr(rdr::HexOutStream::binToHexStr(langIdBuf, sizeof(langId)));
TCharArray infoName(_tcslen(_T("StringFileInfo")) + 4 + _tcslen(name) + _tcslen(langIdStr.buf));
_stprintf(infoName.buf, _T("\\StringFileInfo\\%s\\%s"), langIdStr.buf, name);
diff --git a/win/vncviewer/CConnOptions.cxx b/win/vncviewer/CConnOptions.cxx
index ea0941e5..6069e952 100644
--- a/win/vncviewer/CConnOptions.cxx
+++ b/win/vncviewer/CConnOptions.cxx
@@ -324,7 +324,7 @@ void CConnOptions::writeToFile(const char* filename) {
_T("Storing the password is more convenient but poses a security risk."),
MB_YESNO | MB_DEFBUTTON2 | MB_ICONWARNING) == IDYES) {
ObfuscatedPasswd obfPwd(password);
- CharArray obfuscatedHex = rdr::HexOutStream::binToHexStr(obfPwd.buf, obfPwd.length);
+ CharArray obfuscatedHex(rdr::HexOutStream::binToHexStr(obfPwd.buf, obfPwd.length));
fprintf(f, "Password=%s\n", obfuscatedHex.buf);
}
}
diff --git a/win/vncviewer/CConnThread.cxx b/win/vncviewer/CConnThread.cxx
index cfd26952..0767ffcd 100644
--- a/win/vncviewer/CConnThread.cxx
+++ b/win/vncviewer/CConnThread.cxx
@@ -95,7 +95,7 @@ void CConnThread::run() {
try {
if (isConfig) {
// A configuration file name was specified - load it
- CharArray filename = hostOrConfig.takeBuf();
+ CharArray filename(hostOrConfig.takeBuf());
options.readFromFile(filename.buf);
} else {
// An actual hostname (and possibly port) was specified
diff --git a/win/vncviewer/MRU.h b/win/vncviewer/MRU.h
index ae703b3a..fd9bf71c 100644
--- a/win/vncviewer/MRU.h
+++ b/win/vncviewer/MRU.h
@@ -48,9 +48,9 @@ namespace rfb {
key.getBinary(_T("Order"), (void**)&order.buf, &length);
for (int i=0; i<length; i++) {
- TCharArray keyname = rdr::HexOutStream::binToHexStr(&order.buf[i], 1);
+ TCharArray keyname(rdr::HexOutStream::binToHexStr(&order.buf[i], 1));
try {
- TCharArray entry = key.getString(keyname.buf);
+ TCharArray entry(key.getString(keyname.buf));
mru.push_back(strDup(entry.buf));
} catch (rdr::Exception) {
}
@@ -79,9 +79,9 @@ namespace rfb {
keycode = 0;
bool found = false;
for (int i=0; i<orderlen; i++) {
- TCharArray keyname = rdr::HexOutStream::binToHexStr(&order[i], 1);
+ TCharArray keyname(rdr::HexOutStream::binToHexStr(&order[i], 1));
try {
- TCharArray hostname = key.getString(keyname.buf);
+ TCharArray hostname(key.getString(keyname.buf));
if (stricmp(name, CStr(hostname.buf)) == 0) {
keycode = order[i];
found = true;
@@ -119,7 +119,7 @@ namespace rfb {
order[i] = order[i-1];
order[0] = keycode;
- TCharArray keyname = rdr::HexOutStream::binToHexStr((char*)&keycode, 1);
+ TCharArray keyname(rdr::HexOutStream::binToHexStr((char*)&keycode, 1));
key.setString(keyname.buf, TStr(name));
key.setBinary(_T("Order"), order, orderlen);
}