Skip to content

Commit

Permalink
Merge PR #2524: OSInfo: fix implicit size_t conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrautz committed Aug 24, 2016
2 parents dd14796 + d7ac6f7 commit fc9dc2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OSInfo.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit fc9dc2e

Please sign in to comment.