From d902a4b48a0942a92236fc132464342493915267 Mon Sep 17 00:00:00 2001 From: starnakin Date: Wed, 19 Nov 2025 09:14:20 -0600 Subject: [PATCH] fix: condition loop --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 1d458c8..d2ee26c 100644 --- a/src/main.c +++ b/src/main.c @@ -223,9 +223,9 @@ int main(int ac, char **av) } gettimeofday(&stop, NULL); } - while (!(ret == 1 && buffer[0] == '\0') || (len == packet_size && packet_check(buffer, packet_size) == 0 && packet_compare(packet, buffer, packet_size) == 0)); + while ((ret > 1) && (len != packet_size && packet_check(buffer, packet_size) && packet_compare(packet, buffer, packet_size))); - if (*buffer != 0) + if (ret > 1) { stats.packets_received++; print_recv(&settings, (struct icmphdr *)buffer, &start, &stop);