summaryrefslogtreecommitdiff
path: root/render_sdl.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-07-27 23:49:14 -0700
committerMichael Pavone <pavone@retrodev.com>2015-07-27 23:49:14 -0700
commitc22c2b011eaad9ce65114437bb237ccd3c6e30eb (patch)
treed3792f6e51dcfd2db02ee78e6d00920b92306a46 /render_sdl.c
parent9cf93af158f6964501bb2be8912a19bb572a2170 (diff)
Use binary mode for reading shaders and config files so we actually get the number of bytes we expect
Diffstat (limited to 'render_sdl.c')
-rwxr-xr-xrender_sdl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render_sdl.c b/render_sdl.c
index a2f094e..608d33c 100755
--- a/render_sdl.c
+++ b/render_sdl.c
@@ -117,13 +117,13 @@ GLuint load_shader(char * fname, GLenum shader_type)
{
char * parts[] = {get_home_dir(), "/.config/blastem/shaders/", fname};
char * shader_path = alloc_concat_m(3, parts);
- FILE * f = fopen(shader_path, "r");
+ FILE * f = fopen(shader_path, "rb");
free(shader_path);
if (!f) {
parts[0] = get_exe_dir();
parts[1] = "/shaders/";
shader_path = alloc_concat_m(3, parts);
- f = fopen(shader_path, "r");
+ f = fopen(shader_path, "rb");
free(shader_path);
if (!f) {
warning("Failed to open shader file %s for reading\n", fname);