From 6137b0bdf97237459bf2d368eed42360f5b7451b Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Thu, 11 Jan 2007 20:23:01 +0000 Subject: [PATCH] Fix build on architectures where off_t is signed by casting to uintmax_t before comparing with a size_t. --- usr.bin/head/head.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/head/head.c b/usr.bin/head/head.c index 36aa9bf6cae..5de0cba1316 100644 --- a/usr.bin/head/head.c +++ b/usr.bin/head/head.c @@ -146,7 +146,7 @@ head_bytes(FILE *fp, off_t cnt) size_t readlen; while (cnt) { - if (cnt < sizeof(buf)) + if ((uintmax_t)cnt < sizeof(buf)) readlen = cnt; else readlen = sizeof(buf);