Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/hash fix non-portable shift.



details:   https://anonhg.NetBSD.org/src/rev/a663a321397d
branches:  trunk
changeset: 494383:a663a321397d
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jul 06 02:50:35 2000 +0000

description:
fix non-portable shift.

diffstat:

 lib/libc/hash/rmd160hl.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 5b718d3af333 -r a663a321397d lib/libc/hash/rmd160hl.c
--- a/lib/libc/hash/rmd160hl.c  Thu Jul 06 02:50:22 2000 +0000
+++ b/lib/libc/hash/rmd160hl.c  Thu Jul 06 02:50:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rmd160hl.c,v 1.2 2000/07/05 13:49:25 ad Exp $  */
+/*     $NetBSD: rmd160hl.c,v 1.3 2000/07/06 02:50:35 christos Exp $    */
 
 /* rmd160hl.c
  * ----------------------------------------------------------------------------
@@ -13,7 +13,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rmd160hl.c,v 1.2 2000/07/05 13:49:25 ad Exp $");
+__RCSID("$NetBSD: rmd160hl.c,v 1.3 2000/07/06 02:50:35 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -40,7 +40,7 @@
 
     RMD160Final(digest,ctx);
     for (i = 0; i < 20; i++) {
-       p[i + i] = hex[digest[i] >> 4];
+       p[i + i] = hex[(u_int32_t)digest[i] >> 4];
        p[i + i + 1] = hex[digest[i] & 0x0f];
     }
     p[i + i] = '\0';
@@ -60,7 +60,7 @@
        return(0);
 
     while ((num = read(fd, buffer, sizeof(buffer))) > 0)
-       RMD160Update(&ctx, buffer, num);
+       RMD160Update(&ctx, buffer, (size_t)num);
 
     oerrno = errno;
     close(fd);



Home | Main Index | Thread Index | Old Index