From 70c67f6ed996b9e819e13264024d97200af751ff Mon Sep 17 00:00:00 2001 From: Young-Flash Date: Tue, 31 Dec 2024 16:01:22 +0800 Subject: [PATCH] internal: use moonbit_array_length in native_stub.c --- fs/internal/ffi/native_stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/internal/ffi/native_stub.c b/fs/internal/ffi/native_stub.c index 8afd2c0..af34b1c 100644 --- a/fs/internal/ffi/native_stub.c +++ b/fs/internal/ffi/native_stub.c @@ -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);