Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginSettings.cpp

Issue 6237450183639040: Issue 1283 - wrong usage of memset, fix sizeof, make proper initializing (Closed)
Patch Set: Created Sept. 1, 2014, 11:52 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginSettings.cpp
===================================================================
--- a/src/plugin/PluginSettings.cpp
+++ b/src/plugin/PluginSettings.cpp
@@ -250,15 +250,12 @@
{
if (m_WindowsBuildNumber == 0)
{
- OSVERSIONINFOEX osvi;
- SYSTEM_INFO si;
+ SYSTEM_INFO si = {};
BOOL bOsVersionInfoEx;
- ZeroMemory(&si, sizeof(SYSTEM_INFO));
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
-
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*) &osvi);
+ OSVERSIONINFOEX osvi = {};
+ osvi.dwOSVersionInfoSize = sizeof(osvi);
+ bOsVersionInfoEx = GetVersionExW(reinterpret_cast<OSVERSIONINFO*>(&osvi));
m_WindowsBuildNumber = osvi.dwBuildNumber;
}

Powered by Google App Engine
This is Rietveld