Skip to content
Permalink
Browse files

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

  • Loading branch information...
mkrautz committed Aug 24, 2016
2 parents dd14796 + d7ac6f7 commit fc9dc2e464b22367d035a588dfd9b2690da9ea1e
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/OSInfo.cpp
@@ -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.

0 comments on commit fc9dc2e

Please sign in to comment.
You can’t perform that action at this time.