]> git.draconx.ca Git - liblbx.git/blobdiff - src/error.c
Use (size_t)-1 instead of SIZE_MAX.
[liblbx.git] / src / error.c
index e46c28faf1b5bb696c4caeed86c169f54f7bb5ec..8071547231d4ee5d59a04fa6397dd54cc2781f79 100644 (file)
@@ -50,9 +50,9 @@ int lbx_error_new(const char *str)
                const char **new;
                size_t size;
 
-               if (user_error_max >= MIN(SIZE_MAX, INT_MAX)/2 - LBX_EUBASE)
+               if (user_error_max >= MIN((size_t)-1, INT_MAX)/2 - LBX_EUBASE)
                        return -1;
-               if (2 * user_error_max >= SIZE_MAX / sizeof *user_errors)
+               if (2 * user_error_max >= (size_t)-1 / sizeof *user_errors)
                        return -1;
 
                size = 2 * user_error_max * sizeof *user_errors;