From 04c5e4024fd922cdae4b6b302668af44187c1193 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:26:32 +0100 Subject: Fix another sscanf instance --- plugins/check_ping.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 8d8ae7df..940b9475 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -481,7 +481,8 @@ ping_result run_ping(const char *cmd, const char *addr, double crta) { (sscanf(buf, "%*d packets transmitted, %*d packets received, %d%% packet loss%n", &result.packet_loss, &match) == 1 && match) || (sscanf(buf, "%*d packets transmitted, %*d packets received, %d%% loss, time%n", &result.packet_loss, &match) == 1 && match) || (sscanf(buf, "%*d packets transmitted, %*d received, %d%% loss, time%n", &result.packet_loss, &match) == 1 && match) || - (sscanf(buf, "%*d packets transmitted, %*d received, %d%% packet loss, time%n", &result.packet_loss, &match) && match) == 1 || + (sscanf(buf, "%*d packets transmitted, %*d received, %d%% packet loss, time%n", &result.packet_loss, &match) == 1 && match) == + 1 || (sscanf(buf, "%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n", &result.packet_loss, &match) == 1 && match) || (sscanf(buf, "%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n", &result.packet_loss, &match) == 1 && -- cgit v1.2.3-74-g34f1