Skip to content

Commit af85c84

Browse files
committed
B2DPlugin: do not try to write bytes into a string
1 parent af7a315 commit af85c84

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

plugins/B2DPlugin.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5734,19 +5734,14 @@ function primitiveSetBitBltPlugin() {
57345734
}
57355735
ptr = pluginName.bytes;
57365736
needReload = false;
5737-
for (i = 0; i <= (length - 1); i++) {
57385737

5739-
/* Compare and store the plugin to be used */
5738+
// JS hack: can't copy bytes as in the C version
5739+
var newPluginName = pluginName.bytesAsString();
5740+
if (newPluginName !== bbPluginName) {
5741+
bbPluginName = newPluginName;
5742+
needReload = true;
5743+
}
57405744

5741-
if (bbPluginName[i] !== ptr[i]) {
5742-
bbPluginName[i] = ptr[i];
5743-
needReload = true;
5744-
}
5745-
}
5746-
if (bbPluginName[length] !== 0) {
5747-
bbPluginName[length] = 0;
5748-
needReload = true;
5749-
}
57505745
if (needReload) {
57515746
if (!initialiseModule()) {
57525747
return interpreterProxy.primitiveFail();

0 commit comments

Comments
 (0)