summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-03-15 11:59:50 +0100
committerAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-03-15 11:59:50 +0100
commita6f78aad38333e216ced74e6c51f3449c17dd7b7 (patch)
treeaf3c6fb9a786a0a8c59e68994c16f55d1dbdc5a6 /src
parent5de96dc1d57d017dd06c6be03260b43154b6fc5e (diff)
work
Diffstat (limited to 'src')
-rw-r--r--src/linux/platform.c2
-rw-r--r--src/platform.h1
-rw-r--r--src/windows/platform.c2
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);