summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-s-parser.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index 6b03433b5..95f8a280d 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -453,9 +453,8 @@ public:
// type.operation (e.g. i32.add)
WasmType type = stringToWasmType(str, false, true);
// Local copy to index into op without bounds checking.
- const size_t maxNameSize = 15;
- char op[maxNameSize + 1];
- memset(op, 0, maxNameSize + 1); // ensure the whole string is cleared.
+ enum { maxNameSize = 15 };
+ char op[maxNameSize + 1] = {'\0'};
strncpy(op, dot + 1, maxNameSize);
switch (op[0]) {
case 'a': {