From e892813ac5f253d792d4294de78431a66e4507bc Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" <pesco@khjk.org> Date: Mon, 3 Feb 2020 19:01:54 +0100 Subject: [PATCH] return type of lseek() is off_t --- pdf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdf.c b/pdf.c index 6f342c6..d953890 100644 --- a/pdf.c +++ b/pdf.c @@ -1322,7 +1322,7 @@ main(int argc, char *argv[]) struct Env aux; HParseResult *res = NULL; const uint8_t *input; - size_t sz; + off_t sz; int fd; /* command line handling */ @@ -1339,6 +1339,7 @@ main(int argc, char *argv[]) sz = lseek(fd, 0, SEEK_END); if (sz == -1) err(1, "lseek"); + assert(sz >= 0); input = mmap(NULL, sz?sz:1, PROT_READ, MAP_PRIVATE, fd, 0); if (input == MAP_FAILED) err(1, "mmap"); -- GitLab