From 4359ce3c5f80686d5f62164b42d405e352888475 Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 12 Feb 2009 05:03:47 +0000 Subject: [PATCH] sign-compare fix --- lib/libc/hash/hashhl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/hash/hashhl.c b/lib/libc/hash/hashhl.c index 95ec49cf31f8..8eeaeeafca22 100644 --- a/lib/libc/hash/hashhl.c +++ b/lib/libc/hash/hashhl.c @@ -1,4 +1,4 @@ -/* $NetBSD: hashhl.c,v 1.1 2005/09/28 16:31:45 christos Exp $ */ +/* $NetBSD: hashhl.c,v 1.2 2009/02/12 05:03:47 lukem Exp $ */ /* * ---------------------------------------------------------------------------- @@ -109,7 +109,7 @@ FNPREFIX(FileChunk)(const char *filename, char *buf, off_t off, off_t len) if (off > 0 && lseek(fd, off, SEEK_SET) < 0) return (NULL); - while ((nr = read(fd, buffer, (size_t) MIN(sizeof(buffer), len))) + while ((nr = read(fd, buffer, (size_t) MIN((off_t)sizeof(buffer), len))) > 0) { FNPREFIX(Update)(&ctx, buffer, (unsigned int)nr); if (len > 0 && (len -= nr) == 0)