[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 13/28: prevent division by zero
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 13/28: prevent division by zero |
Date: |
Fri, 10 Mar 2017 18:18:57 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 747694c473ed4a886e7ac4a57bb0f2965674de9a
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 10 17:49:05 2017 +0100
prevent division by zero
---
src/ats-tests/gnunet-ats-sim.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c
index 56f8f2223..0f32df511 100644
--- a/src/ats-tests/gnunet-ats-sim.c
+++ b/src/ats-tests/gnunet-ats-sim.c
@@ -81,15 +81,19 @@ evaluate (struct GNUNET_TIME_Relative duration_total)
duration = (duration_total.rel_value_us / (1000 * 1000));
+ if (0 == duration)
+ duration = 1;
for (c_m = 0; c_m < e->num_masters; c_m++)
{
mp = &masters_p[c_m];
fprintf (stderr,
- _("Master [%u]: sent: %u KiB in %u sec. = %u KiB/s, received: %u KiB
in %u sec. = %u KiB/s\n"),
- mp->no, mp->total_bytes_sent / 1024, duration,
- (mp->total_bytes_sent / 1024) / duration,
- mp->total_bytes_received / 1024, duration,
- (mp->total_bytes_received / 1024) / duration);
+ _("Master [%u]: sent: %u KiB in %u sec. = %u KiB/s, received: %u
KiB in %u sec. = %u KiB/s\n"),
+ mp->no, mp->total_bytes_sent / 1024,
+ duration,
+ (mp->total_bytes_sent / 1024) / duration,
+ mp->total_bytes_received / 1024,
+ duration,
+ (mp->total_bytes_received / 1024) / duration);
for (c_s = 0; c_s < e->num_slaves; c_s++)
{
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 16/28: disambiguate enum type of value, (continued)
- [GNUnet-SVN] [gnunet] 16/28: disambiguate enum type of value, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 09/28: fix memory leak, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 17/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 12/28: fix ICMP IPv4/IPv6 type conversion logic, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 22/28: check return value from dup2, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 14/28: fix double-free, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 11/28: fix double-free, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 18/28: fix integer overflow test to actually work, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 21/28: remove redundant condition in assertion, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 19/28: properly detect and handle parse error, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 13/28: prevent division by zero,
gnunet <=
- [GNUnet-SVN] [gnunet] 23/28: check return value from GNUNET_program_run, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 24/28: fix comment, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 27/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 25/28: use correct channel when switching, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 26/28: add assertion to make static analysis happy, gnunet, 2017/03/10
- [GNUnet-SVN] [gnunet] 28/28: add assertion to make static analysis happy, gnunet, 2017/03/10