Skip to content

Commit

Permalink
internal: use moonbit_array_length in native_stub.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Jan 3, 2025
1 parent 87c0183 commit 70c67f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/internal/ffi/native_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void remove_file(struct moonbit_bytes* path) {

void write_bytes_to_file(struct moonbit_bytes* path, struct moonbit_bytes* content) {
FILE *file = fopen((const char *)(path->data), "wb");
size_t content_size = content->header.arr.len;
size_t content_size = moonbit_array_length(content);
fwrite(content->data, 1, content_size, file);
fflush(file);
fclose(file);
Expand Down

0 comments on commit 70c67f6

Please sign in to comment.