From: Lars Op den Kamp Date: Thu, 29 Mar 2012 09:19:57 +0000 (+0200) Subject: cec: fixed - atoi returns an int, not an int8_t X-Git-Tag: upstream/2.2.0~1^2~31^2~37 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=21d8397898e90f5f90be4b0c7d42922289e8ea25;p=deb_libcec.git cec: fixed - atoi returns an int, not an int8_t --- diff --git a/src/cec-config/cec-config.cpp b/src/cec-config/cec-config.cpp index d5f954e..a7335c7 100644 --- a/src/cec-config/cec-config.cpp +++ b/src/cec-config/cec-config.cpp @@ -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)