diff --git a/solanaceae/util/config_model.inl b/solanaceae/util/config_model.inl index 4efe6a7..ed41c80 100644 --- a/solanaceae/util/config_model.inl +++ b/solanaceae/util/config_model.inl @@ -6,14 +6,14 @@ #include #include -struct CM_InternalStringView { +struct CM_InternalStringView final { const char* start {nullptr}; uint64_t extend {0}; // conversion helpers CM_InternalStringView(const std::string_view sv) : start(sv.data()), extend(sv.size()) {} template - CM_InternalStringView(const char (&str)[N]) : start(str), extend(N) {} + CM_InternalStringView(const char (&str)[N]) : start(str), extend(N-1u) {} CM_InternalStringView(const std::string& str) : start(str.data()), extend(str.size()) {} operator std::string() { return {start, start+extend}; } operator std::string_view() { return {start, extend}; }