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. diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 317cd53..e59e92d 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 v0.10-9-g596f