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

printf("%.f") should use zero precision, not default precision #490

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
%.f should have zero precision, not default precision
  • Loading branch information
manylegged committed Mar 30, 2017
commit e787f6b74b2ff1e55b98b7ac4d850f13386b174e
2 changes: 2 additions & 0 deletions fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ void PrintfFormatter<Char, AF>::format(BasicCStringRef<Char> format_str) {
} else if (*s == '*') {
++s;
spec.precision_ = internal::PrecisionHandler().visit(get_arg(s));
} else {
spec.precision_ = 0;
}
}

Expand Down