From ec9519a0e71354d4b2cd027f8a67d2c86797e626 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 13 Oct 2023 15:19:28 +0100 Subject: [PATCH] - PAL: fixed wrong order of function arguments for fread and fwrite functions --- hal/filesystem/linux/file_provider_linux.c | 4 ++-- hal/filesystem/win32/file_provider_win32.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hal/filesystem/linux/file_provider_linux.c b/hal/filesystem/linux/file_provider_linux.c index 7b501f00..d37a7db1 100644 --- a/hal/filesystem/linux/file_provider_linux.c +++ b/hal/filesystem/linux/file_provider_linux.c @@ -53,13 +53,13 @@ FileSystem_openFile(char* fileName, bool readWrite) int FileSystem_readFile(FileHandle handle, uint8_t* buffer, int maxSize) { - return fread(buffer, maxSize, 1, (FILE*) handle); + return fread(buffer, 1, maxSize, (FILE*) handle); } int FileSystem_writeFile(FileHandle handle, uint8_t* buffer, int size) { - return fwrite(buffer, size, 1, (FILE*) handle); + return fwrite(buffer, 1, size, (FILE*) handle); } void diff --git a/hal/filesystem/win32/file_provider_win32.c b/hal/filesystem/win32/file_provider_win32.c index 1a08e8d1..b51a1a45 100644 --- a/hal/filesystem/win32/file_provider_win32.c +++ b/hal/filesystem/win32/file_provider_win32.c @@ -62,13 +62,13 @@ FileSystem_openFile(char* fileName, bool readWrite) int FileSystem_readFile(FileHandle handle, uint8_t* buffer, int maxSize) { - return fread(buffer, maxSize, 1, (FILE*) handle); + return fread(buffer, 1, maxSize, (FILE*) handle); } int FileSystem_writeFile(FileHandle handle, uint8_t* buffer, int size) { - return fwrite(buffer, size, 1, (FILE*) handle); + return fwrite(buffer, 1, size, (FILE*) handle); } void