cec: fixed - atoi returns an int, not an int8_t
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 29 Mar 2012 09:19:57 +0000 (11:19 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 29 Mar 2012 09:20:52 +0000 (11:20 +0200)
src/cec-config/cec-config.cpp

index d5f954eb7b5e2a4016ac55442fec033dde994c8c..a7335c74a94ccd14bb8f6b75c5233ed9b344d6e3 100644 (file)
@@ -235,11 +235,8 @@ int8_t FindPhysicalAddressPortNumber(void)
   if (input.empty())
     return -1;
 
-  int8_t hdmiport = atoi(input.c_str());
-  if (hdmiport < 1 || hdmiport > 15)
-      return -1;
-
-  return hdmiport;
+  int hdmiport = atoi(input.c_str());
+  return (hdmiport < 1 || hdmiport > 15) ? -1 : (int8_t)hdmiport;
 }
 
 cec_logical_address FindPhysicalAddressBaseDevice(void)