Fix change-of-sign warning with ICC

strlen returns size_t, but -1 is obviously negative.

qglobal.cpp(2261): warning #68: integer conversion resulted in a change
of sign

Change-Id: I255870833a024a36adf6ffff13eb05ce5b2b2595
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira 2015-06-25 08:48:09 -07:00
parent c84625f0d5
commit 86a79260ca

View File

@ -2261,7 +2261,8 @@ static bool readEtcRedHatRelease(QUnixOSVersion &v)
int releaseIndex = line.indexOf(keyword);
v.productType = QString::fromLatin1(line.mid(0, releaseIndex)).remove(QLatin1Char(' '));
int spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword));
v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword), spaceIndex > -1 ? spaceIndex - releaseIndex - strlen(keyword) : -1));
v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword),
spaceIndex > -1 ? spaceIndex - releaseIndex - int(strlen(keyword)) : -1));
return true;
}