From 423284edfa980fc3fdb51ab20af96685a988ba97 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 19 Feb 2023 14:34:29 +0100 Subject: 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. --- plugins-root/check_icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) static int add_target(char *arg) { - int error, result; + int error, result = -1; struct sockaddr_storage ip; struct addrinfo hints, *res, *p; struct sockaddr_in *sin; -- cgit v1.2.3-74-g34f1