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

Fix __libc_fatal('*** invalid %N$ use detected ***') #15

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

haavee
Copy link
Contributor

@haavee haavee commented Nov 2, 2018

Due to my misunderstanding of exactly how to use printf()'s parameter
field
,
then under some PGTBOX(...) settings and with certain time axis range, the
'sprintf(...)' would trigger a __libc_fatal(...) - terminating the user's
application.

The fatal error was only triggered if DAY number was to be displayed and DAY
number was non-negative.

By a simple permutation of the calling arguments and the parameter field(s)
in the format strings this should not happen anymore.

Due to my misunderstanding of _exactly_ how to use `printf()`'s [parameter
field](https://en.wikipedia.org/wiki/Printf_format_string#Parameter_field),
then under some PGTBOX(...) settings and with certain time axis range, the
'sprintf(...)' would trigger an `__libc_fatal(...)` - terminating the user's
application.

The fatal error was only triggered if DAY number was to be displayed and DAY
number was non-negative.

By a simple permutation of the calling arguments and the parameter field(s)
in the format strings this should not happen anymore.
@danieljprice danieljprice merged commit 11a4e82 into danieljprice:master Nov 8, 2018
@danieljprice
Copy link
Owner

thanks!

@haavee haavee deleted the fix-libcfatal branch November 9, 2018 09:05
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