sbase

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

commit d27a0f1f13e5792242b2d148f46fd7835f1ad774
parent 07d2bc7467dfd43ce7ad5a581e268b63da28a127
Author: sin <sin@2f30.org>
Date:   Thu Nov 26 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:
libutil/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; }