From: Mark Andrews Date: Fri, 30 May 2025 00:51:21 +0000 (+1000) Subject: Silence potential divide by zero warning in qpmulti.c X-Git-Tag: v9.21.9~10^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=081dbb110834dc76ae8978a6dd85097382c8e364;p=thirdparty%2Fbind9.git Silence potential divide by zero warning in qpmulti.c Coverity flagged a potential divide by zero error in collect in qpmulti.c when the elapsed time is zero but that is only called once the elapsed time is greater than or equal to RUNTIME (1/4 second) so INSIST this is the case. --- diff --git a/tests/bench/qpmulti.c b/tests/bench/qpmulti.c index 07c151e6c6f..248b740df47 100644 --- a/tests/bench/qpmulti.c +++ b/tests/bench/qpmulti.c @@ -756,6 +756,8 @@ collect(void *varg) { stats[mut].compactions += tp->compactions; } + INSIST(elapsed >= RUNTIME); + printf("%7.3f\t", RUNTIME / (double)NS_PER_SEC); printf("%7.3f\t", elapsed / (double)NS_PER_SEC); printf("%7.3f\t", load_time);