summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-10 14:17:52 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-10 14:17:52 +0000
commitdbb8d57932ef4bb217cf0861ef4f37aeee2be04c (patch)
tree703060b813d8755612a4531164610cb9c5a7eefe /read.c
parentf4ebc442a65493d52d72ca85d0ef785cd81dbbc7 (diff)
downloadmandoc-dbb8d57932ef4bb217cf0861ef4f37aeee2be04c.tar.gz
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.
Diffstat (limited to 'read.c')
-rw-r--r--read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read.c b/read.c
index 7dabc2e4..efd08d1f 100644
--- a/read.c
+++ b/read.c
@@ -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);
}