Conversation
| filtered->PushBack(filtered, obj); | ||
| } | ||
| } | ||
|
|
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the problem, we need to update the format specifier in the mcx_log call to use %zu for size_t arguments. This ensures that the format specifier matches the type of the argument across all platforms.
- Change the format specifier from
%uto%zufor theposandcontainer->sizearguments in themcx_logcall on line 479. - This change should be made in the file
src/objects/ObjectContainer.c.
| @@ -478,3 +478,3 @@ | ||
| if (pos >= container->size) { | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %u out of bounds, max is %u", pos, container->size); | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %zu out of bounds, max is %zu", pos, container->size); | ||
| return RETURN_ERROR; |
| filtered->PushBack(filtered, obj); | ||
| } | ||
| } | ||
|
|
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the problem, we need to update the format specifier in the mcx_log function call on line 479 to match the type of the container->size argument. Specifically, we should change %u to %lu to correctly handle the size_t type, which is typically defined as unsigned long.
- Update the format specifier in the
mcx_logfunction call on line 479 from%uto%lu. - Ensure that the change is made only in the relevant line to avoid altering existing functionality.
| @@ -478,3 +478,3 @@ | ||
| if (pos >= container->size) { | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %u out of bounds, max is %u", pos, container->size); | ||
| mcx_log(LOG_ERROR, "ObjectContainer: SetElementName: Position %lu out of bounds, max is %lu", pos, container->size); | ||
| return RETURN_ERROR; |
No description provided.