diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-02-24 16:36:40 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-02-24 16:36:40 +0000 |
commit | 134da5387304c6b1963bba21f14241402cc085a2 (patch) | |
tree | 2f8da9d9495e879ea42e469e7b537b9282c64789 /src/testing | |
parent | 126827b14598e8d82bc35d7396b87d0f5a6a5e8f (diff) | |
download | gnunet-134da5387304c6b1963bba21f14241402cc085a2.tar.gz gnunet-134da5387304c6b1963bba21f14241402cc085a2.zip |
fixed divide by zero bug
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing_group.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index f1e5ba1e5..5c5f80798 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -1014,6 +1014,8 @@ create_meter(unsigned int total, char * start_string, int print) | |||
1014 | ret->print = print; | 1014 | ret->print = print; |
1015 | ret->total = total; | 1015 | ret->total = total; |
1016 | ret->modnum = total / 4; | 1016 | ret->modnum = total / 4; |
1017 | if (ret->modnum == 0) /* Divide by zero check */ | ||
1018 | ret->modnum = 1; | ||
1017 | ret->dotnum = (total / 50) + 1; | 1019 | ret->dotnum = (total / 50) + 1; |
1018 | if (start_string != NULL) | 1020 | if (start_string != NULL) |
1019 | ret->startup_string = GNUNET_strdup(start_string); | 1021 | ret->startup_string = GNUNET_strdup(start_string); |