summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-07-30 05:12:30 +0000
committerJim Meyering <jim@meyering.net>1995-07-30 05:12:30 +0000
commitea4cda6907ed995c2ff2d4bd59d0c6162767f024 (patch)
tree30ce00a761ef7b525cc4f7ba63e9375b8ec694f1 /lib
parentba477b681a099be6fd0d972b8667c00a7192ab0a (diff)
downloadcoreutils-ea4cda6907ed995c2ff2d4bd59d0c6162767f024.tar.xz
[memcpy]: Define to bcopy if needed.
(md5_buffer): Explicitely cast SWAP expressions to unsigned to avoid warning.
Diffstat (limited to 'lib')
-rw-r--r--lib/md5.c13
1 files 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 <sys/types.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#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);