diff options
author | Pierre Ossman <ossman@cendio.se> | 2020-05-30 20:54:07 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-05-31 11:08:22 +0200 |
commit | b97c84b1d94c8361ee40ef1c7d9c90526729f914 (patch) | |
tree | e26fe41ecc6227871aec0944761938465e59cb53 /win/rfb_win32 | |
parent | 79d1747a272a4f7810a177daa6c582e068c9cee8 (diff) | |
download | tigervnc-b97c84b1d94c8361ee40ef1c7d9c90526729f914.tar.gz tigervnc-b97c84b1d94c8361ee40ef1c7d9c90526729f914.zip |
Don't clear complex objects using memset()
This is fine for simple structs but not class based objects.
Diffstat (limited to 'win/rfb_win32')
-rw-r--r-- | win/rfb_win32/DIBSectionBuffer.cxx | 2 | ||||
-rw-r--r-- | win/rfb_win32/MonitorInfo.cxx | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/win/rfb_win32/DIBSectionBuffer.cxx b/win/rfb_win32/DIBSectionBuffer.cxx index 57bef2dc..424a5787 100644 --- a/win/rfb_win32/DIBSectionBuffer.cxx +++ b/win/rfb_win32/DIBSectionBuffer.cxx @@ -30,12 +30,10 @@ static LogWriter vlog("DIBSectionBuffer"); DIBSectionBuffer::DIBSectionBuffer(HWND window_) : bitmap(0), window(window_), device(0) { - memset(&format, 0, sizeof(format)); } DIBSectionBuffer::DIBSectionBuffer(HDC device_) : bitmap(0), window(0), device(device_) { - memset(&format, 0, sizeof(format)); } DIBSectionBuffer::~DIBSectionBuffer() { diff --git a/win/rfb_win32/MonitorInfo.cxx b/win/rfb_win32/MonitorInfo.cxx index 551017bd..0a949abb 100644 --- a/win/rfb_win32/MonitorInfo.cxx +++ b/win/rfb_win32/MonitorInfo.cxx @@ -36,7 +36,7 @@ using namespace win32; static LogWriter vlog("MonitorInfo"); -static void fillMonitorInfo(HMONITOR monitor, MonitorInfo* mi) { +static void fillMonitorInfo(HMONITOR monitor, MONITORINFOEXA* mi) { vlog.debug("monitor=%p", monitor); memset(mi, 0, sizeof(MONITORINFOEXA)); mi->cbSize = sizeof(MONITORINFOEXA); @@ -70,7 +70,7 @@ MonitorInfo::MonitorInfo(const RECT& r) { struct monitorByNameData { - MonitorInfo* info; + MONITORINFOEXA* info; const char* monitorName; }; |