From 23254e50b44663a69d3431ff3d1840e3f586e86b Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Wed, 12 Dec 2018 14:18:34 +0530 Subject: [PATCH] [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 --- src/inet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.7.4