From ea4cda6907ed995c2ff2d4bd59d0c6162767f024 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 30 Jul 1995 05:12:30 +0000 Subject: [memcpy]: Define to bcopy if needed. (md5_buffer): Explicitely cast SWAP expressions to unsigned to avoid warning. --- lib/md5.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/md5.c b/lib/md5.c index 5f8bb8327..8114795d7 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -24,6 +24,15 @@ #include +#if STDC_HEADERS +# include +# include +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + #include "md5.h" #ifdef WORDS_BIGENDIAN @@ -182,8 +191,8 @@ md5_buffer (buffer, len, resblock) pad = rest >= 56 ? 64 + 56 - rest : 56 - rest; /* Put length of buffer in *bits* in last eight bytes. */ - *(md5_uint32 *) &restbuf[rest + pad] = SWAP (len << 3); - *(md5_uint32 *) &restbuf[rest + pad + 4] = SWAP (len >> 29); + *(md5_uint32 *) &restbuf[rest + pad] = (md5_uint32) SWAP (len << 3); + *(md5_uint32 *) &restbuf[rest + pad + 4] = (md5_uint32) SWAP (len >> 29); /* Process last bytes. */ md5_process_block (restbuf, rest + pad + 8, &ctx); -- cgit v1.2.3-70-g09d2