Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
apps: fix coverity 966560: division by zero
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#14586)
  • Loading branch information
paulidale committed Mar 18, 2021
1 parent 3de7f01 commit 7e7e034
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/s_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ int s_time_main(int argc, char **argv)
nConn, totalTime, ((double)nConn / totalTime), bytes_read);
printf
("%d connections in %ld real seconds, %ld bytes read per connection\n",
nConn, (long)time(NULL) - finishtime + maxtime, bytes_read / nConn);
nConn, (long)time(NULL) - finishtime + maxtime,
nConn > 0 ? bytes_read / nConn : 0l);

/*
* Now loop and time connections using the same session id over and over
Expand Down

0 comments on commit 7e7e034

Please sign in to comment.