summaryrefslogtreecommitdiff
path: root/src/tools/cbr/cbr_client.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-11-16 13:46:36 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-11-16 13:46:36 +0000
commitf7b9a391334130685dca1a85ab5fd3c5407991bf (patch)
tree315bda5299108d0493bca3f6440a8e7ec98a7c01 /src/tools/cbr/cbr_client.c
parentab2fa1e61a56150e23689b41e410028ab8af2251 (diff)
parent6b9176f9ffb29fdc073a2502bbb8d4988d545390 (diff)
downloadouroboros-f7b9a391334130685dca1a85ab5fd3c5407991bf.tar.gz
ouroboros-f7b9a391334130685dca1a85ab5fd3c5407991bf.zip
Merged in dstaesse/ouroboros/be-cbr (pull request #300)
tools: Fix likely overflow in cbr output
Diffstat (limited to 'src/tools/cbr/cbr_client.c')
-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);