Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially fix string_view encoder/decoder #640

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1306,7 +1306,7 @@ private CharSequence generateArrayProperty(
indent + " throw std::runtime_error(\"string too large for put%2$s [E106]\");\n" +
indent + " }\n\n" +
indent + " size_t length = srcLength < %4$d ? srcLength : %4$d;\n" +
indent + " std::memcpy(m_buffer + m_offset + %3$d, str.c_str(), length);\n" +
indent + " std::memcpy(m_buffer + m_offset + %3$d, str.data(), length);\n" +
indent + " for (size_t start = srcLength; start < length; ++start)\n" +
indent + " {\n" +
indent + " m_buffer[m_offset + %3$d + start] = 0;\n" +
Expand Down