From c22c2b011eaad9ce65114437bb237ccd3c6e30eb Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 27 Jul 2015 23:49:14 -0700 Subject: Use binary mode for reading shaders and config files so we actually get the number of bytes we expect --- render_sdl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'render_sdl.c') 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); -- cgit v1.2.3