summaryrefslogtreecommitdiff
path: root/src/tools/cbr
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-11-16 14:26:20 +0100
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-11-16 14:26:20 +0100
commit6b9176f9ffb29fdc073a2502bbb8d4988d545390 (patch)
treebe185c3ebc3dda5d55b55f6182e588f54b4ad4eb /src/tools/cbr
parente90d3b902096a90fc9057c6c9929fac39618c967 (diff)
downloadouroboros-6b9176f9ffb29fdc073a2502bbb8d4988d545390.tar.gz
ouroboros-6b9176f9ffb29fdc073a2502bbb8d4988d545390.zip
tools: Fix likely overflow in cbr output
Diffstat (limited to 'src/tools/cbr')
-rw-r--r--src/tools/cbr/cbr_client.c6
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);