Silence a warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-11-02 11:47:11 +00:00
parent 5baf8ece83
commit fc09f64209

View File

@ -22,14 +22,16 @@ std::string sys::osName() {
}
std::string sys::osVersion() {
OSVERSIONINFO osvi = { 0 };
OSVERSIONINFO osvi;
memset(&osvi, 0, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx(&osvi))
return "";
char buf[64];
sprintf(buf, "%d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
return buf;
char buf[64];
sprintf(buf, "%d.%d", (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion);
return buf;
}