From 6ea2ca8ff42a24d9c7803a60221e0de67f6d76df Mon Sep 17 00:00:00 2001 From: Alexey Ochapov Date: Wed, 2 Dec 2020 21:35:40 +0300 Subject: [PATCH] fix for empty format string --- include/fmt/compile.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index ea0007a4..8b1e3719 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -45,7 +45,7 @@ struct is_compiled_string : std::is_base_of {}; #ifdef FMT_USE_NONTYPE_TEMPLATE_PARAMETERS template struct fixed_string { - constexpr fixed_string(const Char (&str)[N + 1]) { + constexpr fixed_string(const Char (&str)[N]) { copy_str(static_cast(str), str + N, data); } @@ -53,13 +53,13 @@ template struct fixed_string { }; template -fixed_string(const Char (&str)[N]) -> fixed_string; +fixed_string(const Char (&str)[N]) -> fixed_string; template Str> struct udl_compiled_string : compiled_string { using char_type = Char; constexpr operator basic_string_view() const { - return {Str.data, N}; + return {Str.data, N - 1}; } }; #endif