You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The man page for printf states, "If a precision is specified, no more bytes than the number specified are written, but no partial multibyte characters are written. Note that the precision determines the number of bytes written, not the number of wide characters or screen positions. The array must contain a terminating null wide character, unless a precision is given and it is so small that the number of bytes written exceeds it before the end of the array is reached." (Emphasis mine).
In arg_formatter_base::write(const char_type*), the string length is unconditionally computed:
auto length = std::char_traits<char_type>::length(value);
The man page for printf states, "If a precision is specified, no more bytes than the number specified are written, but no partial multibyte characters are written. Note that the precision determines the number of bytes written, not the number of wide characters or screen positions. The array must contain a terminating null wide character, unless a precision is given and it is so small that the number of bytes written exceeds it before the end of the array is reached." (Emphasis mine).
In
arg_formatter_base::write(const char_type*)
, the string length is unconditionally computed:auto length = std::char_traits<char_type>::length(value);
I found that changing this to:
fixed the problem, at least in my case. An example usage that leads to this behavior is:
The text was updated successfully, but these errors were encountered: