Use SSIZE_MAX for overflow check in parseoffset()

There's no such thing as OFF_MAX so we can't use that.  off_t is
signed, so use SSIZE_MAX which will typically match the range of
off_t.
This commit is contained in:
sin 2015-11-26 10:30:35 +00:00
parent 1be832320c
commit 67157b7c4e

View File

@ -52,7 +52,7 @@ parseoffset(const char *str)
}
/* prevent overflow */
if (res > (SIZE_MAX / scale)) {
if (res > (SSIZE_MAX / scale)) {
weprintf("parseoffset %s: out of range\n", str);
return -1;
}