Cast the long to int. Since the value is never greater than 2 bytes this is safe.
This commit is contained in:
parent
5933cf104e
commit
630db4f483
1 changed files with 2 additions and 2 deletions
|
@ -98,8 +98,8 @@ DWORD WINAPI TelldusWinService::deviceNotificationHandler( DWORD controlCode, DW
|
|||
}
|
||||
std::wstring strPID = name.substr(posStart, posEnd-posStart);
|
||||
|
||||
long int vid = strtol(std::string(strVID.begin(), strVID.end()).c_str(), NULL, 16);
|
||||
long int pid = strtol(std::string(strPID.begin(), strPID.end()).c_str(), NULL, 16);
|
||||
int vid = static_cast<int>(strtol(std::string(strVID.begin(), strVID.end()).c_str(), NULL, 16));
|
||||
int pid = static_cast<int>(strtol(std::string(strPID.begin(), strPID.end()).c_str(), NULL, 16));
|
||||
|
||||
if (dwEventType == DBT_DEVICEARRIVAL) {
|
||||
tm->deviceInsertedOrRemoved(vid, pid, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue