From: tb Date: Wed, 31 Aug 2022 12:29:08 +0000 (+0000) Subject: Avoid division by zero if no connection was made. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9c9e7ec38962d0d6787239e41321829fe4a21056;p=openbsd Avoid division by zero if no connection was made. CID 184043 --- diff --git a/usr.bin/openssl/s_time.c b/usr.bin/openssl/s_time.c index cdaac7e8583..92fdb59aa00 100644 --- a/usr.bin/openssl/s_time.c +++ b/usr.bin/openssl/s_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_time.c,v 1.34 2019/07/14 03:30:46 guenther Exp $ */ +/* $OpenBSD: s_time.c,v 1.35 2022/08/31 12:29:08 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -458,9 +458,7 @@ benchmark(int reuse_session) printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", nConn, totalTime, ((double) nConn / totalTime), bytes_read); printf("%d connections in %.0f real seconds, %ld bytes read per connection\n", - nConn, - elapsed, - bytes_read / nConn); + nConn, elapsed, nConn > 0 ? bytes_read / nConn : 0); ret = 0; end: