From 6084c0ff3cfc86461d1a83e24eca054da86f77e3 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Tue, 4 Jan 2022 16:55:46 +0200 Subject: [PATCH] drop extra \0 --- include/fmt/color.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index 4571597c..8bfb5e0d 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -529,13 +529,12 @@ void vprint(std::FILE* f, const text_style& ts, const S& format, basic_format_args>> args) { basic_memory_buffer buf; detail::vformat_to(buf, ts, to_string_view(format), args); - buf.push_back(Char(0)); -#ifdef _WIN32 if (detail::is_utf8()) detail::print(f, basic_string_view(buf.begin(), buf.size())); - else -#endif + else { + buf.push_back(Char(0)); detail::fputs(buf.data(), f); + } } /**