From: Niraj Kumar Goit Date: Wed, 12 Dec 2018 08:48:34 +0000 (+0530) Subject: [Upstream] Fix return value in error path. X-Git-Tag: accepted/tizen/unified/20181219.063352~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F195702%2F2;p=platform%2Fupstream%2Fconnman.git [Upstream] Fix return value in error path. Returning -1 in a function with bool as return value is the same as returning true. Change to false to indicate error if inet_aton() fails. Change-Id: I3dea40bc2506b1a2a0a65e7e838691fc3af957bd Signed-off-by: Niraj Kumar Goit --- diff --git a/src/inet.c b/src/inet.c index 25e5372..d54760d 100644 --- a/src/inet.c +++ b/src/inet.c @@ -1108,7 +1108,7 @@ bool connman_inet_compare_subnet(int index, const char *host) return false; if (inet_aton(host, &_host_addr) == 0) - return -1; + return false; host_addr = _host_addr.s_addr; sk = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);