From 586630ee92a46a463566d9f713fa7d90f8283948 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 10 Mar 2015 14:17:52 +0000 Subject: The st_size member of struct stat is off_t, which is signed, all required by POSIX. So don't compare it against against an unsigned constant. --- read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/read.c b/read.c index 0b4caa05..763bf4e9 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.129 2015/03/02 14:50:17 schwarze Exp $ */ +/* $Id: read.c,v 1.130 2015/03/10 14:17:52 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 (st.st_size >= (1U << 31)) { + if ((size_t)st.st_size >= (1U << 31)) { mandoc_msg(MANDOCERR_TOOLARGE, curp, 0, 0, NULL); return(0); } -- cgit v1.2.3-56-ge451