diff options
| author | tb <> | 2022-08-31 12:29:08 +0000 |
|---|---|---|
| committer | tb <> | 2022-08-31 12:29:08 +0000 |
| commit | 5fdcead22234749d49d79e5fc2b4d6bd7f4d5f27 (patch) | |
| tree | f25046efcb901f61e568e2c639c099ed64784ebd /src | |
| parent | 3f280b44879c3920cfaa23c9c04d888efe53c72a (diff) | |
| download | openbsd-5fdcead22234749d49d79e5fc2b4d6bd7f4d5f27.tar.gz openbsd-5fdcead22234749d49d79e5fc2b4d6bd7f4d5f27.tar.bz2 openbsd-5fdcead22234749d49d79e5fc2b4d6bd7f4d5f27.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: |
