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