From 3a27d85c4ea374bde196c8261ec4d4758e48d6dd Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 21 May 2018 21:26:25 +1000 Subject: [PATCH] Use sizeof instead of constant value --- wolfcrypt/src/misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/misc.c b/wolfcrypt/src/misc.c index ffb03a8d1..872652d20 100644 --- a/wolfcrypt/src/misc.c +++ b/wolfcrypt/src/misc.c @@ -202,7 +202,8 @@ STATIC INLINE void ForceZero(const void* mem, word32 len) #if defined(WOLFSSL_X86_64_BUILD) && defined(WORD64_AVAILABLE) volatile word64* w; #ifndef WOLFSSL_UNALIGNED_64BIT_ACCESS - word32 l = (8 - ((size_t)z & 0x7)) & 0x7; + word32 l = (sizeof(word64) - ((size_t)z & (sizeof(word64)-1))) & + (sizeof(word64)-1); if (len < l) l = len; len -= l;