From 0e6a3cd7cc7c0509ea77ce7df571af1c24fb4c94 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Thu, 7 Nov 2013 15:14:36 +1030 Subject: [PATCH] Use interval parameter correctly even for unlimited pings --- commandline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commandline.c b/commandline.c index 8a9c7d62..ab474b41 100644 --- a/commandline.c +++ b/commandline.c @@ -986,7 +986,7 @@ int app_mdp_ping(const struct cli_parsed *parsed, struct cli_context *context) /* Now look for replies until one second has passed, and print any replies with appropriate information as required */ time_ms_t now = gettime_ms(); - time_ms_t finish = now + (tx_count < icount?interval_ms:timeout_ms); + time_ms_t finish = now + ((tx_count < icount || icount==0)?interval_ms:timeout_ms); for (; !servalShutdown && now < finish; now = gettime_ms()) { time_ms_t poll_timeout_ms = finish - gettime_ms();