use stringToUTF8() not writeAsciiToMemory()
This commit is contained in:
parent
fcc312abd3
commit
005cd56829
@ -1,8 +1,9 @@
|
||||
module.exports = (Core, args) => {
|
||||
const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);
|
||||
args.forEach((s, idx) => {
|
||||
const buf = Core._malloc(s.length + 1);
|
||||
Core.writeAsciiToMemory(s, buf);
|
||||
const sz = s.length*4 + 1;
|
||||
const buf = Core._malloc(sz);
|
||||
Core.stringToUTF8(s, buf, sz);
|
||||
Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');
|
||||
});
|
||||
return [args.length, argsPtr];
|
||||
|
Loading…
Reference in New Issue
Block a user