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

Unified Diff: src/plugin/PluginSettings.cpp

Issue 5163581322559488: Issue 1283 - wrong usage of memset, fix sizeof, make proper initializing (Closed)
Patch Set: Created Oct. 8, 2014, 2:49 p.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
« no previous file with comments | « src/plugin/PluginClass.cpp ('k') | src/plugin/PluginSystem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginSettings.cpp
===================================================================
--- a/src/plugin/PluginSettings.cpp
+++ b/src/plugin/PluginSettings.cpp
@@ -231,12 +231,17 @@
{
if (m_WindowsBuildNumber == 0)
{
- OSVERSIONINFOEX osvi = {};
- osvi.dwOSVersionInfoSize = sizeof(osvi);
- if (GetVersionExW(reinterpret_cast<OSVERSIONINFO*>(&osvi)) != 0)
- {
- m_WindowsBuildNumber = osvi.dwBuildNumber;
- }
+ OSVERSIONINFOEX osvi;
+ SYSTEM_INFO si;
+ BOOL bOsVersionInfoEx;
+
+ ZeroMemory(&si, sizeof(SYSTEM_INFO));
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
+
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*) &osvi);
+
+ m_WindowsBuildNumber = osvi.dwBuildNumber;
}
return m_WindowsBuildNumber;
« no previous file with comments | « src/plugin/PluginClass.cpp ('k') | src/plugin/PluginSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld