From f14efbb4e0be98cc51e1537e05780d034782ecbb Mon Sep 17 00:00:00 2001 From: tholo Date: Wed, 30 Apr 1997 05:56:05 +0000 Subject: [PATCH] Make possible truncation of long value more explicit --- lib/libc/md/md4c.c | 4 ++-- lib/libc/md/md5c.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/md/md4c.c b/lib/libc/md/md4c.c index f182d518649..f85d41cc6c3 100644 --- a/lib/libc/md/md4c.c +++ b/lib/libc/md/md4c.c @@ -22,7 +22,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md4c.c,v 1.8 1997/01/07 10:09:00 niklas Exp $"; +static char rcsid[] = "$OpenBSD: md4c.c,v 1.9 1997/04/30 05:56:05 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -193,7 +193,7 @@ MD4_CTX *context; /* context */ /* Save number of bits */ hi = context->count >> 32; - lo = context->count & 0xffffffff; + lo = (u_int32_t)context->count & 0xffffffff; Encode (bits, &lo, 4); Encode (bits + 4, &hi, 4); diff --git a/lib/libc/md/md5c.c b/lib/libc/md/md5c.c index f8ec90d6a55..672c45afffc 100644 --- a/lib/libc/md/md5c.c +++ b/lib/libc/md/md5c.c @@ -23,7 +23,7 @@ documentation and/or software. */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md5c.c,v 1.8 1997/01/07 10:09:00 niklas Exp $"; +static char rcsid[] = "$OpenBSD: md5c.c,v 1.9 1997/04/30 05:56:06 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -205,7 +205,7 @@ MD5_CTX *context; /* context */ /* Save number of bits */ hi = context->count >> 32; - lo = context->count & 0xffffffff; + lo = (u_int32_t)context->count & 0xffffffff; Encode (bits, &lo, 4); Encode (bits + 4, &hi, 4); -- 2.20.1