From 3437e06ae30e3c2d9bd32c111b7ca7e8ab012716 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sun, 24 Aug 2025 14:44:08 +0200 Subject: [PATCH] initialize all resp_times array entries Before, the resp_times array was initialized starting with the second entry, leaving the first entry uninitialized. This is at least confusing. Initializing one additional int64_t value per ping target should not add too much overhead, so do this just to be on the safe side. Assuming that the first array entry need not be initialized when creating the array now, this guards against potential problems from future code changes that do not take this unexpected special case into account. --- src/fping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fping.c b/src/fping.c index 8db952a..e9d89bf 100644 --- a/src/fping.c +++ b/src/fping.c @@ -3548,7 +3548,7 @@ void add_addr(char *name, char *host, struct sockaddr *ipaddr, socklen_t ipaddr_ if (!i) crash_and_burn("can't allocate resp_times array"); - for (n = 1; n < trials; n++) + for (n = 0; n < trials; n++) i[n] = RESP_UNUSED; p->resp_times = i; -- 2.43.0