summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm')
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.cpp2
-rw-r--r--src/plugins/platforms/wasm/qwasmstring.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp
index fd53cd0bae..ee3f6afb73 100644
--- a/src/plugins/platforms/wasm/qwasmintegration.cpp
+++ b/src/plugins/platforms/wasm/qwasmintegration.cpp
@@ -133,7 +133,7 @@ QWasmIntegration::QWasmIntegration()
Q_UNUSED(userData);
// This resize event is called when the HTML window is resized. Depending
- // on the page layout the the canvas(es) might also have been resized, so we
+ // on the page layout the canvas(es) might also have been resized, so we
// update the Qt screen sizes (and canvas render sizes).
if (QWasmIntegration *integration = QWasmIntegration::get())
integration->resizeAllScreens();
diff --git a/src/plugins/platforms/wasm/qwasmstring.cpp b/src/plugins/platforms/wasm/qwasmstring.cpp
index 05b571c459..b1be405eeb 100644
--- a/src/plugins/platforms/wasm/qwasmstring.cpp
+++ b/src/plugins/platforms/wasm/qwasmstring.cpp
@@ -52,9 +52,10 @@ QString QWasmString::toQString(const val &v)
val::global("Module")["stringToUTF16"]);
static const val length("length");
- result.resize(v[length].as<int>());
+ int len = v[length].as<int>();
+ result.resize(len);
auto ptr = quintptr(result.utf16());
- stringToUTF16(v, val(ptr));
+ stringToUTF16(v, val(ptr), val((len + 1) * 2));
return result;
}