diff --git a/libluna/src/String.cpp b/libluna/src/String.cpp index e606e77a..f8f00464 100644 --- a/libluna/src/String.cpp +++ b/libluna/src/String.cpp @@ -155,7 +155,8 @@ Result String::from_string_view(StringView str) String result; result.m_inline = true; result.m_length = str.length(); - strncpy(result.m_inline_storage, str.chars(), sizeof(m_inline_storage)); + memset(result.m_inline_storage, 0, sizeof(result.m_inline_storage)); + memcpy(result.m_inline_storage, str.chars(), str.length()); return result; }