commit 5ef98fdec958130a92aa40006ddd9daba36b4d12
Author:     Laslo Hunhold <d...@frign.de>
AuthorDate: Tue Aug 16 16:51:17 2022 +0200
Commit:     Laslo Hunhold <d...@frign.de>
CommitDate: Tue Aug 16 16:51:17 2022 +0200

    Use SIZE_MAX instead of (size_t)(-1)
    
    Thanks Mattias for pointing this out!
    
    Signed-off-by: Laslo Hunhold <d...@frign.de>

diff --git a/gen/util.c b/gen/util.c
index bfe0dbf..012b04a 100644
--- 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;
        }

Reply via email to