diff options
| author | tb <> | 2024-03-27 01:22:30 +0000 |
|---|---|---|
| committer | tb <> | 2024-03-27 01:22:30 +0000 |
| commit | 34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8 (patch) | |
| tree | c0c42a2b8c4163dc6824836c943bda44cac3d87e /src/lib/libcrypto/rsa/rsa_lib.c | |
| parent | 71e785c49d7143edbfb309d799e532de7857e689 (diff) | |
| download | openbsd-34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8.tar.gz openbsd-34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8.tar.bz2 openbsd-34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8.zip | |
Unify *_up_ref() implementations
No need for an inconsistently named local variable and a ternary operator.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_lib.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_lib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index b379cddc07..91f4938ec9 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_lib.c,v 1.49 2023/11/19 15:46:10 tb Exp $ */ | 1 | /* $OpenBSD: rsa_lib.c,v 1.50 2024/03/27 01:22:30 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 | * |
| @@ -192,8 +192,7 @@ LCRYPTO_ALIAS(RSA_free); | |||
| 192 | int | 192 | int |
| 193 | RSA_up_ref(RSA *r) | 193 | RSA_up_ref(RSA *r) |
| 194 | { | 194 | { |
| 195 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); | 195 | return CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA) > 1; |
| 196 | return i > 1 ? 1 : 0; | ||
| 197 | } | 196 | } |
| 198 | LCRYPTO_ALIAS(RSA_up_ref); | 197 | LCRYPTO_ALIAS(RSA_up_ref); |
| 199 | 198 | ||
