libgrapheme

unicode string library
git clone git://git.suckless.org/libgrapheme
Log | Files | Refs | README | LICENSE

commit 5ef98fdec958130a92aa40006ddd9daba36b4d12
parent aa5dda2687c4907d6a47e57b1d7973b8f9d158ae
Author: Laslo Hunhold <dev@frign.de>
Date:   Tue, 16 Aug 2022 16:51:17 +0200

Use SIZE_MAX instead of (size_t)(-1)

Thanks Mattias for pointing this out!

Signed-off-by: Laslo Hunhold <dev@frign.de>

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

diff --git a/gen/util.c b/gen/util.c @@ -34,7 +34,7 @@ struct break_test_payload static void * reallocate_array(void *p, size_t len, size_t size) { - if (len > 0 && size > (size_t)(-1) / len) { + if (len > 0 && size > SIZE_MAX / len) { errno = ENOMEM; return NULL; }