changeset 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 1f3ddeaacaee
children e95978c0988c
files config.c render_sdl.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/config.c	Mon Jul 27 23:42:54 2015 -0700
+++ b/config.c	Mon Jul 27 23:49:14 2015 -0700
@@ -91,7 +91,7 @@
 tern_node * parse_config_file(char * config_path)
 {
 	tern_node * ret = NULL;
-	FILE * config_file = fopen(config_path, "r");
+	FILE * config_file = fopen(config_path, "rb");
 	if (!config_file) {
 		goto open_fail;
 	}
--- 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);