summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-02-19 14:34:29 +0100
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-02-19 14:34:29 +0100
commit423284edfa980fc3fdb51ab20af96685a988ba97 (patch)
tree66fcb2167046b317221a677cc5154e2ed2863b72
parentd3a4bad51d72a3c5bcc06ceb5e0a823dcc24bf49 (diff)
downloadmonitoring-plugins-423284edfa980fc3fdb51ab20af96685a988ba97.tar.gz
check_icmp: Fix compiler warning
This fixes a compiler warning which complains about an uninitialized value for a variable which is then returned. This had no real world impact, since the program would crash in the branch where result is not set. The variable is initialized to "-1" which would be the error for inet_pton.
-rw-r--r--plugins-root/check_icmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 317cd535..e59e92d3 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -1339,7 +1339,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in)
1339static int 1339static int
1340add_target(char *arg) 1340add_target(char *arg)
1341{ 1341{
1342 int error, result; 1342 int error, result = -1;
1343 struct sockaddr_storage ip; 1343 struct sockaddr_storage ip;
1344 struct addrinfo hints, *res, *p; 1344 struct addrinfo hints, *res, *p;
1345 struct sockaddr_in *sin; 1345 struct sockaddr_in *sin;