refactor: Use UINT64_MAX to replace hardcoded number (#15676)

This commit is contained in:
Yang Hau 2021-03-04 01:16:18 +08:00 committed by GitHub
parent 0970653b6a
commit 6acb06f8d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
extern uint64_t entrypoint(const uint8_t *input) {
{
// Confirm large allocation fails
void *ptr = sol_calloc(1, UINT64_MAX); // TODO use max
void *ptr = sol_calloc(1, UINT64_MAX);
if (ptr != NULL) {
sol_log("Error: Alloc of very larger buffer should fail");
sol_panic();
@ -16,7 +16,7 @@ extern uint64_t entrypoint(const uint8_t *input) {
{
// Confirm large allocation fails
void *ptr = sol_calloc(18446744073709551615U, 1); // TODO use max
void *ptr = sol_calloc(UINT64_MAX, 1);
if (ptr != NULL) {
sol_log("Error: Alloc of very larger buffer should fail");
sol_panic();