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

format_to_n doesn't format characters with printf-style format strings #1473

Closed
timwoj opened this issue Dec 11, 2019 · 1 comment
Closed

Comments

@timwoj
Copy link

timwoj commented Dec 11, 2019

Similar to #778, but with printf-style format strings:

This code snippet:

char tmp[25];
auto res = fmt::format_to_n(tmp, 25, "%d", 12345);
printf("%lu\n", res.size);
printf("%s\n", tmp);

results in this output:

2
%d

It appears to work completely fine with python-style format strings like {}.

@vitaut
Copy link
Contributor

vitaut commented Dec 11, 2019

format_to_n uses Python-style format strings.

@vitaut vitaut closed this as completed Dec 11, 2019
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