summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wasm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index b13011bae..393f0529b 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1180,7 +1180,7 @@ public:
Segment() {}
Segment(size_t offset, const char *init, size_t size) : offset(offset) {
data.resize(size);
- memcpy(&data[0], init, size);
+ std::copy_n(init, size, data.begin());
}
Segment(size_t offset, std::vector<char>& init) : offset(offset) {
data.swap(init);