[Upstream] Fix return value in error path. 02/195702/2
authorNiraj Kumar Goit <niraj.g@samsung.com>
Wed, 12 Dec 2018 08:48:34 +0000 (14:18 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Mon, 17 Dec 2018 10:15:15 +0000 (10:15 +0000)
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 <niraj.g@samsung.com>
src/inet.c

index 25e5372..d54760d 100644 (file)
@@ -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);