diff options
author | Sam Clegg <sbc@chromium.org> | 2016-10-07 09:59:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 09:59:55 -0700 |
commit | 619868dbb7ec3d8e5d012f5d23c59e6f4e9fb12e (patch) | |
tree | 7e3f9744ce11d60f99966a1b3307fdd21de7fcc2 /src | |
parent | 63765fce649e2e65c4ac029c0ac5e0f1471cc51b (diff) | |
download | wabt-619868dbb7ec3d8e5d012f5d23c59e6f4e9fb12e.tar.gz wabt-619868dbb7ec3d8e5d012f5d23c59e6f4e9fb12e.tar.bz2 wabt-619868dbb7ec3d8e5d012f5d23c59e6f4e9fb12e.zip |
Remove trailing whitespace from hexdumps (#154)
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-stream.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wasm-stream.c b/src/wasm-stream.c index b809fdb3..a64638e0 100644 --- a/src/wasm-stream.c +++ b/src/wasm-stream.c @@ -142,12 +142,14 @@ void wasm_write_memory_dump(WasmStream* stream, wasm_write_char(stream, ' '); } - wasm_write_char(stream, ' '); - p = line; - int i; - for (i = 0; i < DUMP_OCTETS_PER_LINE && p < end; ++i, ++p) - if (print_chars) + if (print_chars == WASM_PRINT_CHARS) { + wasm_write_char(stream, ' '); + p = line; + int i; + for (i = 0; i < DUMP_OCTETS_PER_LINE && p < end; ++i, ++p) wasm_write_char(stream, isprint(*p) ? *p : '.'); + } + /* if there are multiple lines, only print the desc on the last one */ if (p >= end && desc) wasm_writef(stream, " ; %s", desc); |