From a6f78aad38333e216ced74e6c51f3449c17dd7b7 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 15 Mar 2020 11:59:50 +0100 Subject: work --- src/linux/platform.c | 2 +- src/platform.h | 1 + src/windows/platform.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/linux/platform.c b/src/linux/platform.c index 5f48ea1..daa0120 100644 --- a/src/linux/platform.c +++ b/src/linux/platform.c @@ -261,7 +261,7 @@ bool platform_directory_exists(char *path) s32 platform_get_file_size(char *path) { - FILE *file = fopen(path, "r"); + FILE *file = fopen(path, "rb"); if (!file) return -1; fseek(file, 0 , SEEK_END); diff --git a/src/platform.h b/src/platform.h index 6a32212..b3d30e9 100644 --- a/src/platform.h +++ b/src/platform.h @@ -124,6 +124,7 @@ typedef enum t_file_open_error FILE_ERROR_REMOTE_IO_ERROR = 8, FILE_ERROR_STALE = 9, // NFS server file is removed/renamed FILE_ERROR_GENERIC = 10, + FILE_ERROR_TOO_BIG = 11, } file_open_error; struct open_dialog_args diff --git a/src/windows/platform.c b/src/windows/platform.c index 3d6c7dd..70a1b7d 100644 --- a/src/windows/platform.c +++ b/src/windows/platform.c @@ -782,7 +782,7 @@ void platform_window_swap_buffers(platform_window *window) s32 platform_get_file_size(char *path) { - FILE *file = fopen(path, "r"); + FILE *file = fopen(path, "rb"); if (!file) return -1; fseek(file, 0 , SEEK_END); -- cgit v1.2.3-70-g09d2