Skip to content

[rcore] Fix logging format for automation event capacity warning - #5986

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
GideonSerf:fix-automation-error-logging
Jul 17, 2026
Merged

[rcore] Fix logging format for automation event capacity warning#5986
raysan5 merged 1 commit into
raysan5:masterfrom
GideonSerf:fix-automation-error-logging

Conversation

@GideonSerf

Copy link
Copy Markdown
Contributor

The format specifiers and arguments in this log statement are mismatched:

else TRACELOG(LOG_WARNING, "AUTOMATION: Event goes beyond automated list capacity (MAX: %i): %s", buffer, list.capacity);

The format string expects an integer followed by a string, but the arguments are passed as a string followed by an unsigned integer. If the automated event list reaches capacity, such as when 16,385 event lines are encountered, this mismatch can result in undefined behavior and potentially a crash.

This change swaps the arguments into the correct order and replaces %i with %u to match the unsigned type of list.capacity.

@raysan5

raysan5 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

@GideonSerf Good catch! Thanks for the fix! Note that the events automation should be probably redesigned or at least disabled by default on config in the future...

@raysan5
raysan5 merged commit 7aceceb into raysan5:master Jul 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants