From 28c64ef7d8e531be233dbb56110c421b37a08706 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 19 Sep 2024 20:41:12 +0200 Subject: [PATCH] samples: fix console output in pi example for Wasm BE --- samples/pi/src/main/webapp/wasm.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/pi/src/main/webapp/wasm.html b/samples/pi/src/main/webapp/wasm.html index 29601f787..f7cf5480a 100644 --- a/samples/pi/src/main/webapp/wasm.html +++ b/samples/pi/src/main/webapp/wasm.html @@ -37,8 +37,9 @@ let memory = new Int8Array(instance.exports.memory.buffer); let string = ""; for (let i = 0; i < count; ++i) { - string += $rt_putStdoutCustom(memory[address++]); + string += String.fromCharCode(memory[address++]); } + $rt_putStdoutCustom(string); } o.teavm.putwcharsOut = putwchars; o.teavm.putwcharsErr = putwchars;