Skip to content

Commit

Permalink
[svrplus] svrplus.c: Fix an uninitialized variable warning in cppcheck.
Browse files Browse the repository at this point in the history
Not likely to occur, but fix it anyway.

Found using cppcheck-2.6 dev. (git: main/9d51b445)
  • Loading branch information
GerbilSoft committed Aug 4, 2021
1 parent 28a473b commit b6ab51c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/svrplus/svrplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,15 @@ static void InitDialog(HWND hDlg)

// MSVC 2019 runtime requires Windows Vista or later.
osvi.dwOSVersionInfoSize = sizeof(osvi);
if (GetVersionEx(&osvi) != 0) {
if (osvi.dwMajorVersion >= 6) {
// Windows Vista or later. Use MSVC 2019.
vcyear = 2019;
vcver = 16;
} else {
// Windows XP/2003 or earlier. Use MSVC 2017.
vcyear = 2017;
vcver = 15;
}
if (GetVersionEx(&osvi) != 0 && osvi.dwMajorVersion >= 6) {
// Windows Vista or later. Use MSVC 2019.
vcyear = 2019;
vcver = 16;
} else {
// Windows XP/2003 or earlier, or GetVersionEx() failed.
// Use MSVC 2017.
vcyear = 2017;
vcver = 15;
}

// Go through the various permutations.
Expand Down

0 comments on commit b6ab51c

Please sign in to comment.