-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
use memory_buffer to make color print behave atomic #1348 #1351
Conversation
I do not feel I try to format it and Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
Thanks for the feedback. |
@vitaut I am happy with the current version and seems CI is also happy now:D So feel free to review it. |
Merged, thanks! |
} | ||
buf.push_back(Char(0)); | ||
internal::fputs(buf.data(), f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it is unusual, the result of formatting args may contain zero bytes, then this fputs will truncate it and will not reset the color.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for bring that up! But I don't think I understand what you mean... Could you give an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the test in https://github.com/fmtlib/fmt/pull/1356/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah.. Yes, that's a good point, in case there is a terminator in the string, that won't work.
After fmtlib#1351 they became essentially the same.
This is a clean up after fmtlib#1351.
This is a clean up after fmtlib#1351.
After fmtlib#1351 they became essentially the same.
After #1351 they became essentially the same.
This is a clean up after fmtlib#1351.
I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.
I did not have time to read the whole coding standard, but I did try to following the existing style.
Please do point out if there is any formating issue.
Thanks for your time :)