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

Plus flag formatting with locale is broken #2133

Closed
mp-t opened this issue Feb 12, 2021 · 1 comment
Closed

Plus flag formatting with locale is broken #2133

mp-t opened this issue Feb 12, 2021 · 1 comment

Comments

@mp-t
Copy link

mp-t commented Feb 12, 2021

fmt::format(std::locale("en_US.UTF-8"), "{:+L}", 100); produces an out-of-bounds memory access and wrong output.

Possible output: "-100" or ",100" depening on the fmt version.
Expected output: "100"

Godbolt sample

@vitaut vitaut changed the title Format with locale is broken. Plus flag formatting with locale is broken. Feb 13, 2021
@vitaut vitaut changed the title Plus flag formatting with locale is broken. Plus flag formatting with locale is broken Feb 13, 2021
@vitaut
Copy link
Contributor

vitaut commented Feb 13, 2021

Fixed '+' handling with locale in ee0fed6. Thanks for reporting.

@vitaut vitaut closed this as completed Feb 13, 2021
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

No branches or pull requests

2 participants