From d63e16568602c2845543acd93bc322272a7ab788 Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 27 Mar 2024 01:22:30 +0000 Subject: Unify *_up_ref() implementations No need for an inconsistently named local variable and a ternary operator. ok jsing --- src/lib/libcrypto/rsa/rsa_lib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/rsa/rsa_lib.c') 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 @@ -/* $OpenBSD: rsa_lib.c,v 1.49 2023/11/19 15:46:10 tb Exp $ */ +/* $OpenBSD: rsa_lib.c,v 1.50 2024/03/27 01:22:30 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -192,8 +192,7 @@ LCRYPTO_ALIAS(RSA_free); int RSA_up_ref(RSA *r) { - int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); - return i > 1 ? 1 : 0; + return CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA) > 1; } LCRYPTO_ALIAS(RSA_up_ref); -- cgit v1.2.3-55-g6feb