From 630db4f4837aee13aaf9e3f3a772ff6b08b6e6fe Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Wed, 5 Dec 2012 13:59:31 +0100 Subject: [PATCH] Cast the long to int. Since the value is never greater than 2 bytes this is safe. --- telldus-core/service/TelldusWinService_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telldus-core/service/TelldusWinService_win.cpp b/telldus-core/service/TelldusWinService_win.cpp index e566d66d..cea51638 100644 --- a/telldus-core/service/TelldusWinService_win.cpp +++ b/telldus-core/service/TelldusWinService_win.cpp @@ -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(strtol(std::string(strVID.begin(), strVID.end()).c_str(), NULL, 16)); + int pid = static_cast(strtol(std::string(strPID.begin(), strPID.end()).c_str(), NULL, 16)); if (dwEventType == DBT_DEVICEARRIVAL) { tm->deviceInsertedOrRemoved(vid, pid, true);