summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_shift.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-05 00:00:15 +0200
committerRich Salz <rsalz@openssl.org>2015-05-06 04:18:59 +0200
commit16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 (patch)
tree3c30094cad38433c24008c30efe3d93cf38d8ae9 /crypto/bn/bn_shift.c
parentZLIB compression deserves a better comment (diff)
downloadopenssl-16f8d4ebf0fd4847fa83d9c61f4150273cb4f533.tar.xz
openssl-16f8d4ebf0fd4847fa83d9c61f4150273cb4f533.zip
memset, memcpy, sizeof consistency fixes
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bn/bn_shift.c')
-rw-r--r--crypto/bn/bn_shift.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c
index b6cd0d920e..9895646afa 100644
--- a/crypto/bn/bn_shift.c
+++ b/crypto/bn/bn_shift.c
@@ -154,10 +154,7 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
t[nw + i + 1] |= (l >> rb) & BN_MASK2;
t[nw + i] = (l << lb) & BN_MASK2;
}
- memset(t, 0, nw * sizeof(t[0]));
- /*
- * for (i=0; i<nw; i++) t[i]=0;
- */
+ memset(t, 0, sizeof(*t) * nw);
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);