sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 67157b7c4ea433f3a8dcbdfb5dbbc21108268852
parent 1be832320cfcf14f5e544ea0d6d791255f7b0c2c
Author: sin <sin@2f30.org>
Date:   Thu, 26 Nov 2015 10:30:35 +0000

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.

Diffstat:
Mlibutil/parseoffset.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libutil/parseoffset.c b/libutil/parseoffset.c @@ -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; }