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: remove intializating call Created Oct. 13, 2014, 9:47 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
@@ -231,17 +231,12 @@
{
if (m_WindowsBuildNumber == 0)
{
- 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;
+ OSVERSIONINFOEX osvi = {};
+ osvi.dwOSVersionInfoSize = sizeof(osvi);
+ if (GetVersionExW(reinterpret_cast<OSVERSIONINFO*>(&osvi)) != 0)
+ {
+ m_WindowsBuildNumber = osvi.dwBuildNumber;
+ }
}
return m_WindowsBuildNumber;

Powered by Google App Engine
This is Rietveld