From: Andy Polyakov Date: Thu, 14 Feb 2013 08:51:41 +0000 (+0100) Subject: bn_nist.c: work around clang 3.0 bug. X-Git-Tag: OpenSSL_1_0_2-beta1~411 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b9eef988836097356ce7b463049d108f3b97eb10;p=oweals%2Fopenssl.git bn_nist.c: work around clang 3.0 bug. (cherry picked from commit 750398acd85a7ae220d272d28a76dff7bb269c31) --- diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c index 0797f92918..e22968d4a3 100644 --- a/crypto/bn/bn_nist.c +++ b/crypto/bn/bn_nist.c @@ -286,29 +286,25 @@ const BIGNUM *BN_get0_nist_prime_521(void) } -static void nist_cp_bn_0(BN_ULONG *buf, const BN_ULONG *a, int top, int max) +static void nist_cp_bn_0(BN_ULONG *dst, const BN_ULONG *src, int top, int max) { int i; - BN_ULONG *_tmp1 = (buf); - const BN_ULONG *_tmp2 = (a); #ifdef BN_DEBUG OPENSSL_assert(top <= max); #endif - for (i = (top); i != 0; i--) - *_tmp1++ = *_tmp2++; - for (i = (max) - (top); i != 0; i--) - *_tmp1++ = (BN_ULONG) 0; + for (i = 0; i < top; i++) + dst[i] = src[i]; + for (; i < max; i++) + dst[i] = 0; } -static void nist_cp_bn(BN_ULONG *buf, const BN_ULONG *a, int top) +static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) { int i; - BN_ULONG *_tmp1 = (buf); - const BN_ULONG *_tmp2 = (a); - for (i = (top); i != 0; i--) - *_tmp1++ = *_tmp2++; + for (i = 0; i < top; i++) + dst[i] = src[i]; } #if BN_BITS2 == 64