diff --git a/src/constexpr_string.cpp b/src/constexpr_string.cpp index f736c55..6cd0337 100644 --- a/src/constexpr_string.cpp +++ b/src/constexpr_string.cpp @@ -33,7 +33,7 @@ struct ConstexprString { std::ranges::copy_n(data, Size, this->data.begin()); }; explicit constexpr ConstexprString(std::string_view data) : data{} { - std::ranges::copy_n(data.begin(), Size, this->data.begin()); + std::ranges::copy_n(data.begin(), data.size() > this->size() ? this->size() : data.size(), this->data.begin()); }; explicit constexpr ConstexprString(std::array data) : data(std::move(data)) {}; constexpr auto size() const {