-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373475: Unintentional format string in logString of AccessInfo.cpp #28950
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,8 +97,7 @@ void logString(FILE *logfile, const char *msg, ...) { | |
| va_start(argprt, msg); | ||
| vsnprintf(tmpbuf, sizeof(tmpbuf), msg, argprt); | ||
|
|
||
| fprintf(logfile, tmpbuf); | ||
| fprintf(logfile, "\n"); | ||
| fprintf(logfile, "%s\n", tmpbuf); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't we use Alternatively, use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A similar pattern is used elsewhere in this file. And I don't want this fix to become a reworking of this code, because that isn't a goal here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After reading about fputs, I think this is best. Like you mentioned, no ambiguity since it does not use specifiers. Updated.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Indeed, it is. I agree it's better to keep the code consistent. At the same time, I think it's worth submitting a bug to simplify usages like that,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since Damon already made the change and its just one line I'm fine to keep it but not go looking for more. |
||
| fflush(logfile); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.