From b67a85dab66fe36699996392b6a251d46e21302c Mon Sep 17 00:00:00 2001 From: Michael Winterberg Date: Mon, 4 Mar 2019 11:08:13 -0800 Subject: [PATCH] Changed to use strlen instead of sizeof to determine the length of a string. Addresses #1063. --- include/fmt/color.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index 39c52c2fa1c2..e79ebe3955e8 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -514,7 +514,7 @@ template <> inline void reset_color(FILE* stream) FMT_NOEXCEPT { template inline void reset_color(basic_memory_buffer& buffer) FMT_NOEXCEPT { const char* begin = data::RESET_COLOR; - const char* end = begin + sizeof(data::RESET_COLOR) - 1; + const char* end = begin + std::char_traits::length(data::RESET_COLOR); buffer.append(begin, end); }