From 2ec9b3390d268ce8e51cc1f7bef5042e5b6036c0 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 16 Oct 2015 17:12:17 +0200 Subject: [PATCH] Fully initialize OSVERSIONINFOEX struct Use wxZeroMemory() instead of explicitly initializing struct fields with zeroes, this is simpler and less error-prone. --- src/msw/utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index eab054013a..1a4e8137d6 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1265,7 +1265,10 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) bool wxCheckOsVersion(int majorVsn, int minorVsn) { - OSVERSIONINFOEX osvi = { sizeof(osvi), 0, 0, 0, 0, { 0 }, 0, 0 }; + OSVERSIONINFOEX osvi; + wxZeroMemory(osvi); + osvi.dwOSVersionInfoSize = sizeof(osvi); + DWORDLONG const dwlConditionMask = ::VerSetConditionMask( ::VerSetConditionMask(