From ec0ab2170cf2225c59b47e31ac9508d0d1b8065d Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Mon, 15 Dec 2025 00:09:48 +0000 Subject: [PATCH] Fix file reading --- src/core/file/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/file/file.c b/src/core/file/file.c index 30550c7..e1f6eb6 100644 --- a/src/core/file/file.c +++ b/src/core/file/file.c @@ -77,7 +77,7 @@ u64 wapp_file_read(Array *dst_buf, File *file, u64 item_count) { copy_byte_count = file_length <= dst_byte_capacity ? file_length : dst_byte_capacity; } - u64 count = fread(dst_buf, sizeof(u8), copy_byte_count, file); + u64 count = fread(dst_buf->items, sizeof(u8), copy_byte_count, file); if (ferror(file)) { return 0; } dst_buf->count = count / item_size; @@ -94,7 +94,7 @@ u64 wapp_file_write(const Array *src_buf, File *file, u64 item_count) { u64 req_byte_count = item_count * item_size; u64 to_copy = req_byte_count <= src_byte_count ? req_byte_count : src_byte_count; - return fwrite(src_buf, sizeof(u8), to_copy, file); + return fwrite(src_buf->items, sizeof(u8), to_copy, file); } i32 wapp_file_flush(File *file) {