diff options
author | dimitri staessens <[email protected]> | 2016-11-16 14:26:20 +0100 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-11-16 14:26:20 +0100 |
commit | 6b9176f9ffb29fdc073a2502bbb8d4988d545390 (patch) | |
tree | be185c3ebc3dda5d55b55f6182e588f54b4ad4eb /src/tools/cbr/cbr_client.c | |
parent | e90d3b902096a90fc9057c6c9929fac39618c967 (diff) | |
download | ouroboros-6b9176f9ffb29fdc073a2502bbb8d4988d545390.tar.gz ouroboros-6b9176f9ffb29fdc073a2502bbb8d4988d545390.zip |
tools: Fix likely overflow in cbr output
Diffstat (limited to 'src/tools/cbr/cbr_client.c')
-rw-r--r-- | src/tools/cbr/cbr_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/cbr/cbr_client.c b/src/tools/cbr/cbr_client.c index b2cf7d7f..58198b86 100644 --- a/src/tools/cbr/cbr_client.c +++ b/src/tools/cbr/cbr_client.c @@ -46,7 +46,7 @@ int client_main(char * server, int result = 0; bool stop = false; char buf[size]; - int seqnr = 0; + long seqnr = 0; long gap = size * 8.0 * (BILLION / (double) rate); struct timespec start; @@ -114,8 +114,8 @@ int client_main(char * server, ms = ts_diff_ms(&start, &end); printf("sent statistics: " - "%9d SDUs, %12d bytes in %9d ms, %4.4f Mb/s\n", - seqnr, seqnr * size, ms, (seqnr * size * 8.0)/(ms * 1000)); + "%9ld SDUs, %12ld bytes in %9d ms, %4.4f Mb/s\n", + seqnr, seqnr * size, ms, (seqnr / (ms * 1000.0)) * size * 8.0); flow_dealloc(fd); |