diff options
| author | tb <> | 2022-08-31 12:29:08 +0000 |
|---|---|---|
| committer | tb <> | 2022-08-31 12:29:08 +0000 |
| commit | 15eca26842e04912050d30a972fcce04e046da8a (patch) | |
| tree | f25046efcb901f61e568e2c639c099ed64784ebd /src | |
| parent | 5a6829457443fa46793532384f028224fb524030 (diff) | |
| download | openbsd-15eca26842e04912050d30a972fcce04e046da8a.tar.gz openbsd-15eca26842e04912050d30a972fcce04e046da8a.tar.bz2 openbsd-15eca26842e04912050d30a972fcce04e046da8a.zip | |
Avoid division by zero if no connection was made.
CID 184043
Diffstat (limited to 'src')
| -rw-r--r-- | src/usr.bin/openssl/s_time.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index cdaac7e858..92fdb59aa0 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s_time.c,v 1.34 2019/07/14 03:30:46 guenther Exp $ */ | 1 | /* $OpenBSD: s_time.c,v 1.35 2022/08/31 12:29:08 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -458,9 +458,7 @@ benchmark(int reuse_session) | |||
| 458 | printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", | 458 | printf("\n\n%d connections in %.2fs; %.2f connections/user sec, bytes read %ld\n", |
| 459 | nConn, totalTime, ((double) nConn / totalTime), bytes_read); | 459 | nConn, totalTime, ((double) nConn / totalTime), bytes_read); |
| 460 | printf("%d connections in %.0f real seconds, %ld bytes read per connection\n", | 460 | printf("%d connections in %.0f real seconds, %ld bytes read per connection\n", |
| 461 | nConn, | 461 | nConn, elapsed, nConn > 0 ? bytes_read / nConn : 0); |
| 462 | elapsed, | ||
| 463 | bytes_read / nConn); | ||
| 464 | 462 | ||
| 465 | ret = 0; | 463 | ret = 0; |
| 466 | end: | 464 | end: |
