summaryrefslogtreecommitdiff
path: root/src/shared_string.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared_string.hh')
-rw-r--r--src/shared_string.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared_string.hh b/src/shared_string.hh
index 0725c613..f9adf737 100644
--- a/src/shared_string.hh
+++ b/src/shared_string.hh
@@ -26,7 +26,7 @@ struct StringStorage : UseMemoryDomain<MemoryDomain::SharedString>
const int len = (int)str.length() + (back != 0 ? 1 : 0);
void* ptr = StringStorage::operator new(sizeof(StringStorage) + len + 1);
StringStorage* res = reinterpret_cast<StringStorage*>(ptr);
- memcpy(res->data(), str.data(), (int)str.length());
+ std::copy(str.begin(), str.end(), res->data());
res->refcount = 0;
res->length = len;
if (back != 0)