From b80343877477b4a1d3f16f2fd965d3cb69a5bba8 Mon Sep 17 00:00:00 2001 From: haukepetersen Date: Tue, 30 Jun 2015 14:44:15 +0200 Subject: [PATCH] sys/shell: fixed percentage calc of ping6 shell cmd --- sys/shell/commands/sc_icmpv6_echo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/shell/commands/sc_icmpv6_echo.c b/sys/shell/commands/sc_icmpv6_echo.c index 3fb2818c98..eb3f55fabb 100644 --- a/sys/shell/commands/sc_icmpv6_echo.c +++ b/sys/shell/commands/sc_icmpv6_echo.c @@ -220,7 +220,8 @@ int _icmpv6_ping(int argc, char **argv) if (success > 0) { timex_normalize(&sum_rtt); printf("%d packets transmitted, %d received, %d%% packet loss, time %" - PRIu32 ".06%" PRIu32 " s\n", n, success, (success - n) / n, + PRIu32 ".06%" PRIu32 " s\n", n, success, + (100 - ((success * 100) / n)), sum_rtt.seconds, sum_rtt.microseconds); timex_t avg_rtt = timex_from_uint64(timex_uint64(sum_rtt) / n); /* get average */ printf("rtt min/avg/max = "