Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple_sprintf() -> snprintf() and fix format specifier / datatype for time_t #1775

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Feb 10, 2025

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
simple_sprintf() -> snprintf() and fix format specifier / datatype for time_t

Additional description (if needed):
See also:

eggdrop/src/botmsg.c

Lines 138 to 141 in 541e8ac

// TODO: this should probably not be used eggdrop core anymore
// and only stay for 3rd party module compatibility
// Reason: No sane compiler error checking possible, hardcoded 1024 limit
int simple_sprintf (char *buf, const char *format, ...)

eggdrops simple_sprintf() brings a %D specifier for converting int to base64. Those are harder to migrate to snprintf(). But all others should be migrated over time. One benefit is indeed that the compiler will be able to do more checks.

Test cases demonstrating functionality (if applicable):

Fix format specifier / datatype for time_t
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.

1 participant