summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-10-01 12:35:13 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-10-01 12:35:13 +0200
commit89ba3f1b4f1688e56a34adc4ae0b24971ba6649c (patch)
treef9d4b435e0fa6610d7c0cbdd5cf33ca439f32dc5 /src/rest.c
parente81685bba0d9f1d6a28c0375f118df57667bedf0 (diff)
src: inet_aton() returns 0 on error
not < 0, fix this.
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rest.c b/src/rest.c
index a9eae33..f33486c 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -603,7 +603,7 @@ static int og_cmd_wol(json_t *element, struct og_msg_params *params)
if (og_client_find(new_params.ips_array[i]))
continue;
- if (inet_aton(new_params.ips_array[i], &addr) < 0)
+ if (!inet_aton(new_params.ips_array[i], &addr))
continue;
cli_wol = og_client_wol_find(&addr);
@@ -618,7 +618,7 @@ static int og_cmd_wol(json_t *element, struct og_msg_params *params)
list_add_tail(&cli_wol->list, &client_wol_list);
- if (inet_aton(new_params.netmask_array[i], &netmask) < 0)
+ if (!inet_aton(new_params.netmask_array[i], &netmask))
continue;
if (wake_up(sd, &addr, &netmask, new_params.mac_array[i],
@@ -2011,7 +2011,7 @@ static int og_cmd_get_client_info(json_t *element,
if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR))
return -1;
- if (inet_aton(params->ips_array[0], &addr) == 0)
+ if (!inet_aton(params->ips_array[0], &addr))
return -1;
dbi = og_dbi_open(&ogconfig.db);