Portability fix for broken compilers.
[u/mdw/catacomb] / md5.c
diff --git a/md5.c b/md5.c
index 55a0aaa..fa078e9 100644 (file)
--- a/md5.c
+++ b/md5.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: md5.c,v 1.2 1999/12/10 23:20:03 mdw Exp $
+ * $Id: md5.c,v 1.3 2000/06/17 11:31:43 mdw Exp $
  *
  * The MD5 message digest function
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: md5.c,v $
+ * Revision 1.3  2000/06/17 11:31:43  mdw
+ * Portability fix for broken compilers.
+ *
  * Revision 1.2  1999/12/10 23:20:03  mdw
  * New hash interface requirements.
  *
@@ -217,7 +220,7 @@ void md5_set(md5_ctx *ctx, const void *buf, unsigned long count)
   ctx->d = LOAD32_L(p + 12);
   ctx->off = 0;
   ctx->nl = U32(count);
-  ctx->nh = U32((count >> 16) >> 16);
+  ctx->nh = U32(((count & ~MASK32) >> 16) >> 16);
 }
 
 /* --- @md5_hash@ --- *