From b0d20148ca7a55127315f5ef158ee8de802e8b4f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 11 Mar 2015 13:05:20 +0000 Subject: Fix previous: size_t is often narrower than off_t. Cluestick applied by joerg at NetBSD. --- read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'read.c') diff --git a/read.c b/read.c index 763bf4e9..471d4150 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.130 2015/03/10 14:17:52 schwarze Exp $ */ +/* $Id: read.c,v 1.131 2015/03/11 13:05:20 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -636,7 +636,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd, */ if (S_ISREG(st.st_mode)) { - if ((size_t)st.st_size >= (1U << 31)) { + if (st.st_size > 0x7fffffff) { mandoc_msg(MANDOCERR_TOOLARGE, curp, 0, 0, NULL); return(0); } -- cgit v1.2.3-56-ge451