diff options
author | Jim Meyering <jim@meyering.net> | 1995-07-30 05:12:30 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1995-07-30 05:12:30 +0000 |
commit | ea4cda6907ed995c2ff2d4bd59d0c6162767f024 (patch) | |
tree | 30ce00a761ef7b525cc4f7ba63e9375b8ec694f1 /lib | |
parent | ba477b681a099be6fd0d972b8667c00a7192ab0a (diff) | |
download | coreutils-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.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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); |