mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
libmd5sum: fix strict-aliasing warning
Origin commit data
------------------
Commit: c4065cb778
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-03-24 (Sun, 24 Mar 2013)
This commit is contained in:
@@ -97,6 +97,7 @@ md5_finish_ctx (ctx, resbuf)
|
|||||||
/* Take yet unprocessed bytes into account. */
|
/* Take yet unprocessed bytes into account. */
|
||||||
md5_uint32 bytes = ctx->buflen;
|
md5_uint32 bytes = ctx->buflen;
|
||||||
size_t pad;
|
size_t pad;
|
||||||
|
md5_uint32 *p;
|
||||||
|
|
||||||
/* Now count remaining bytes. */
|
/* Now count remaining bytes. */
|
||||||
ctx->total[0] += bytes;
|
ctx->total[0] += bytes;
|
||||||
@@ -107,9 +108,10 @@ md5_finish_ctx (ctx, resbuf)
|
|||||||
memmove (&ctx->buffer[bytes], fillbuf, pad);
|
memmove (&ctx->buffer[bytes], fillbuf, pad);
|
||||||
|
|
||||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
/* 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);
|
p = (md5_uint32 *)&ctx->buffer[bytes + pad];
|
||||||
*(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
|
*p = SWAP (ctx->total[0] << 3);
|
||||||
(ctx->total[0] >> 29));
|
p++;
|
||||||
|
*p = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
|
||||||
|
|
||||||
/* Process last bytes. */
|
/* Process last bytes. */
|
||||||
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||||
|
Reference in New Issue
Block a user