summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ats/gnunet-service-ats_normalization.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c
index c10e5070f..017e14327 100644
--- a/src/ats/gnunet-service-ats_normalization.c
+++ b/src/ats/gnunet-service-ats_normalization.c
@@ -85,8 +85,10 @@ update_avg (uint64_t current_val,
sum += (double) ni->atsi_abs[c1];
}
}
- GNUNET_assert (0 != count);
- ni->avg = sum / count;
+ if (0 == count)
+ ni->avg = curent_val; /* must be UINT64_MAX */
+ else
+ ni->avg = sum / count;
}