aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-15 14:41:47 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commitd608a30d576ed74f7dc7374c1f00d2303fee27f6 (patch)
treea6637dee5800ee1f9af6331d3df02d84afe45d9a /win/rfb_win32
parentef8c84eb752e1b59ef824cedeb156b2d64fefe37 (diff)
downloadtigervnc-d608a30d576ed74f7dc7374c1f00d2303fee27f6.tar.gz
tigervnc-d608a30d576ed74f7dc7374c1f00d2303fee27f6.zip
Use fixed size character buffer
We know the needed space here, so let's keep it simple with a constant size string buffer.
Diffstat (limited to 'win/rfb_win32')
-rw-r--r--win/rfb_win32/ComputerName.h6
-rw-r--r--win/rfb_win32/ModuleFileName.h7
2 files changed, 6 insertions, 7 deletions
diff --git a/win/rfb_win32/ComputerName.h b/win/rfb_win32/ComputerName.h
index 345ff0d7..e7064d5b 100644
--- a/win/rfb_win32/ComputerName.h
+++ b/win/rfb_win32/ComputerName.h
@@ -20,18 +20,18 @@
#define __RFB_WIN32_COMPUTERNAME_H__
#include <windows.h>
-#include <rfb/util.h>
namespace rfb {
namespace win32 {
// Get the computer name
- struct ComputerName : CharArray {
- ComputerName() : CharArray(MAX_COMPUTERNAME_LENGTH+1) {
+ struct ComputerName {
+ ComputerName() {
ULONG namelength = MAX_COMPUTERNAME_LENGTH+1;
if (!GetComputerName(buf, &namelength))
strcpy(buf, "");
}
+ char buf[MAX_COMPUTERNAME_LENGTH+1];
};
};
diff --git a/win/rfb_win32/ModuleFileName.h b/win/rfb_win32/ModuleFileName.h
index 02a34f1a..9a06f50d 100644
--- a/win/rfb_win32/ModuleFileName.h
+++ b/win/rfb_win32/ModuleFileName.h
@@ -21,18 +21,17 @@
#include <windows.h>
-#include <rfb/util.h>
-
namespace rfb {
namespace win32 {
- struct ModuleFileName : public CharArray {
- ModuleFileName(HMODULE module=0) : CharArray(MAX_PATH) {
+ struct ModuleFileName {
+ ModuleFileName(HMODULE module=0) {
if (!module)
module = GetModuleHandle(0);
if (!GetModuleFileName(module, buf, MAX_PATH))
buf[0] = 0;
}
+ char buf[MAX_PATH];
};
};