summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2016-11-05 10:47:16 +0000
committermiod <miod@openbsd.org>2016-11-05 10:47:16 +0000
commitd8091d7f5ae1ba5e3488208acad65313ca302a90 (patch)
treede33f03bb72c60d9992d6c4952bc5c33adfb971b
parentRemove the obj, xobj and src directories from the base set. (diff)
downloadwireguard-openbsd-d8091d7f5ae1ba5e3488208acad65313ca302a90.tar.xz
wireguard-openbsd-d8091d7f5ae1ba5e3488208acad65313ca302a90.zip
Stop abusing the ternary operator to decide which function to call in a
return statement. ok beck@ jsing@
-rw-r--r--lib/libcrypto/bn/bn_mod.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libcrypto/bn/bn_mod.c b/lib/libcrypto/bn/bn_mod.c
index 67bd3541b0c..eb2d5b072e7 100644
--- a/lib/libcrypto/bn/bn_mod.c
+++ b/lib/libcrypto/bn/bn_mod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_mod.c,v 1.9 2014/07/12 16:03:36 miod Exp $ */
+/* $OpenBSD: bn_mod.c,v 1.10 2016/11/05 10:47:16 miod Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project. */
/* ====================================================================
@@ -125,8 +125,11 @@ BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
return 0;
if (!r->neg)
return 1;
- /* now -|d| < r < 0, so we have to set r := r + |d| */
- return (d->neg ? BN_sub : BN_add)(r, r, d);
+ /* now -|d| < r < 0, so we have to set r := r + |d| */
+ if (d->neg)
+ return BN_sub(r, r, d);
+ else
+ return BN_add(r, r, d);
}
int