summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2016-03-29 11:16:55 -0700
committerJF Bastien <jfb@chromium.org>2016-03-29 11:16:55 -0700
commit137f11440fb6639b4ec6a30ca1bc817f4fba8e88 (patch)
tree10011a40c2d085a55d1487c8d1be86d47ead6b9b /src
parentbaac207cf0fe3f207f067b7edec2d6ea6e9e4f65 (diff)
downloadbinaryen-137f11440fb6639b4ec6a30ca1bc817f4fba8e88.tar.gz
binaryen-137f11440fb6639b4ec6a30ca1bc817f4fba8e88.tar.bz2
binaryen-137f11440fb6639b4ec6a30ca1bc817f4fba8e88.zip
Use static const, and init in-line
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..e7d1347a0 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.
+ static const size_t maxNameSize = 15;
+ char op[maxNameSize + 1] = {'\0'};
strncpy(op, dot + 1, maxNameSize);
switch (op[0]) {
case 'a': {