From cedfb2c434c8adff6f15de869b44f917b46ad609 Mon Sep 17 00:00:00 2001 From: Olaf Meeuwissen Date: Wed, 7 Sep 2016 21:03:30 +0900 Subject: [PATCH] md5: fix [-Wstrict-aliasing] compiler warnings --- lib/md5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/md5.c b/lib/md5.c index fd53191c7..72b36f352 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -133,8 +133,8 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ - *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); - *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | + ((md5_uint32 *) ctx->buffer)[bytes + pad] = SWAP (ctx->total[0] << 3); + ((md5_uint32 *) ctx->buffer)[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */