diff --git a/src/lib/libwasmfs_node.js b/src/lib/libwasmfs_node.js index 586eb3c77722f..6735281205bb9 100644 --- a/src/lib/libwasmfs_node.js +++ b/src/lib/libwasmfs_node.js @@ -206,7 +206,7 @@ addToLibrary({ return wasmfsTry(() => { // TODO: Cache open file descriptors to guarantee that opened files will // still exist when we try to access them. - let nread = fs.readSync(fd, new Int8Array(HEAPU8.buffer, buf_p, len), 0, len, pos); + let nread = fs.readSync(fd, HEAPU8, buf_p, len, pos); {{{ makeSetValue('nread_p', 0, 'nread', 'i32') }}}; // implicitly return 0 }); @@ -217,7 +217,7 @@ addToLibrary({ return wasmfsTry(() => { // TODO: Cache open file descriptors to guarantee that opened files will // still exist when we try to access them. - let nwritten = fs.writeSync(fd, new Int8Array(HEAPU8.buffer, buf_p, len), 0, len, pos); + let nwritten = fs.writeSync(fd, HEAPU8, buf_p, len, pos); {{{ makeSetValue('nwritten_p', 0, 'nwritten', 'i32') }}}; // implicitly return 0 });