diff render_sdl.c @ 816:7ed55a361e79

Use binary mode for reading shaders and config files so we actually get the number of bytes we expect
author Michael Pavone <pavone@retrodev.com>
date Mon, 27 Jul 2015 23:49:14 -0700
parents ec23202df6a6
children b6842dfb8edf
line wrap: on
line diff
--- a/render_sdl.c	Mon Jul 27 23:42:54 2015 -0700
+++ b/render_sdl.c	Mon Jul 27 23:49:14 2015 -0700
@@ -117,13 +117,13 @@
 {
 	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);