Skip to content

Commit 557c3fb

Browse files
authored
[WasmFS] Use const uint8_t* in JS API impl. NFC (#24706)
In line with #23825.
1 parent bee9a1c commit 557c3fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

system/lib/wasmfs/js_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int _wasmfs_read_file(const char* path, uint8_t** out_buf, off_t* out_size) {
6464

6565
// Writes to a file, possibly creating it, and returns the number of bytes
6666
// written successfully. If the file already exists, appends to it.
67-
int _wasmfs_write_file(const char* pathname, char* data, size_t data_size) {
67+
int _wasmfs_write_file(const char* pathname, const uint8_t* data, size_t data_size) {
6868
auto parsedParent = path::parseParent(pathname);
6969
if (parsedParent.getError()) {
7070
return 0;
@@ -100,7 +100,7 @@ int _wasmfs_write_file(const char* pathname, char* data, size_t data_size) {
100100
}
101101

102102
auto offset = lockedFile.getSize();
103-
auto result = lockedFile.write((uint8_t*)data, data_size, offset);
103+
auto result = lockedFile.write(data, data_size, offset);
104104
if (result != __WASI_ERRNO_SUCCESS) {
105105
return 0;
106106
}

0 commit comments

Comments
 (0)