diff options
author | dimitri staessens <[email protected]> | 2017-04-03 06:58:09 +0000 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-04-03 06:58:09 +0000 |
commit | 1d4728bcf572c3ebc1632fec9a6751d6644087ce (patch) | |
tree | f27c679531f16b2a6e89072da592f4549a96d7c9 /src/tools/oping | |
parent | bfb4d3794c5916f297aa8173d1ce52acc23dfb77 (diff) | |
parent | 8c9c6c9360c9d034c7b89107199766d252edbea8 (diff) | |
download | ouroboros-1d4728bcf572c3ebc1632fec9a6751d6644087ce.tar.gz ouroboros-1d4728bcf572c3ebc1632fec9a6751d6644087ce.zip |
Merged in dstaesse/ouroboros/be-oping (pull request #455)
tools: Fix oping client output
Diffstat (limited to 'src/tools/oping')
-rw-r--r-- | src/tools/oping/oping_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index 43f402a2..4cc14623 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -233,8 +233,8 @@ int client_main(void) printf("--- %s ping statistics ---\n", client.s_apn); printf("%d SDUs transmitted, ", client.sent); printf("%d received, ", client.rcvd); - printf("%d%% packet loss, ", client.sent == 0 ? 0 : - 100 - (100 * (client.rcvd / client.sent))); + printf("%.0lf%% packet loss, ", client.sent == 0 ? 0 : + ceil(100 - (100 * (client.rcvd / (float) client.sent)))); printf("time: %.3f ms\n", ts_diff_us(&tic, &toc) / 1000.0); if (client.rcvd > 0) { |