t/read-to-pipe-async: Do not divide by zero
authorBart Van Assche <bvanassche@acm.org>
Sat, 11 Jan 2020 23:42:49 +0000 (15:42 -0800)
committerBart Van Assche <bvanassche@acm.org>
Sun, 12 Jan 2020 02:17:37 +0000 (18:17 -0800)
commitb38cc6cb679e2f48dbdef43b1d70b7a1f9278945
tree034f9d6d4be6b21bea9911a421b10b0dba4ec56c
parent63ef965dc21350ad093f3072b201ae965800c41b
t/read-to-pipe-async: Do not divide by zero

This patch fixes the following Coverity complaint:

23. zero_return: Function call utime_since(&s, &re) returns 0.
CID 280732 (#2 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)
24. divide_by_zero: In expression bytes * 1000UL * 1000UL / utime_since(&s, &re), division by expression utime_since(&s, &re) which may be zero has undefined behavior.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
t/read-to-pipe-async.c