Skip to content

Commit 271d2b6

Browse files
committed
Use stringToUTF8 instead of deprecated writeStringToMemory
1 parent 115181c commit 271d2b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wrapper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ function setupMethods (soljson) {
1414
var compileStandard = null;
1515
if (('_compileJSONCallback' in soljson) || ('_compileStandard' in soljson)) {
1616
var copyString = function (str, ptr) {
17-
var buffer = soljson._malloc(str.length + 1);
18-
soljson.writeStringToMemory(str, buffer);
17+
var length = soljson.lengthBytesUTF8(str);
18+
var buffer = soljson._malloc(length + 1);
19+
soljson.stringToUTF8(str, buffer, length + 1);
1920
soljson.setValue(ptr, buffer, '*');
2021
};
2122
var wrapCallback = function (callback) {

0 commit comments

Comments
 (0)