From c7a9dffe66ce564e5673ee62d382f8381a1261fb Mon Sep 17 00:00:00 2001 From: kou029w Date: Sat, 22 Apr 2017 00:23:13 +0900 Subject: [PATCH] Fixed a bug in all cases of Transmit failed --- src/k2ping.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k2ping.ino b/src/k2ping.ino index 6fc9078..6b40fdd 100644 --- a/src/k2ping.ino +++ b/src/k2ping.ino @@ -109,7 +109,7 @@ void ping_recv_cb(void *_option, void *_resp) { } if (errors + success >= opt->count) { - avg_time /= success; + if (success > 0) avg_time /= success; lcd.clear(); p((char*)"%4dbyte%3d%%loss", total_bytes, 100 * errors / opt->count); lcd.setCursor(0, 2);