Skip to content

[WasmFS] Use const char* in JS API impl. NFC #24706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/lib/wasmfs/js_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int _wasmfs_read_file(const char* path, uint8_t** out_buf, off_t* out_size) {

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

auto offset = lockedFile.getSize();
auto result = lockedFile.write((uint8_t*)data, data_size, offset);
auto result = lockedFile.write((const uint8_t*)data, data_size, offset);
if (result != __WASI_ERRNO_SUCCESS) {
return 0;
}
Expand Down