Merge PR #2524: OSInfo: fix implicit size_t conversion.

This commit is contained in:
Mikkel Krautz 2016-08-24 21:52:59 +00:00 committed by GitHub
commit fc9dc2e464

View File

@ -34,7 +34,9 @@ static QString regString(wchar_t *string, int size) {
// that the NUL is not included in the returned
// string.
const size_t adjustedSize = wcsnlen(string, static_cast<size_t>(size));
return QString::fromWCharArray(string, adjustedSize);
// The return value of wcsnlen is <= size which is
// an int, so casting adjustedSize to int is safe.
return QString::fromWCharArray(string, static_cast<int>(adjustedSize));
}
/// Query for a Windows 10-style displayable version.