json_load_file: Open the input file in rb mode
authorPetri Lehtinen <petri@digip.org>
Tue, 4 Oct 2011 18:11:26 +0000 (21:11 +0300)
committerPetri Lehtinen <petri@digip.org>
Tue, 4 Oct 2011 18:11:31 +0000 (21:11 +0300)
For maximum compatibility.

src/load.c

index 8942dd9..d60a93e 100644 (file)
@@ -947,7 +947,7 @@ json_t *json_load_file(const char *path, size_t flags, json_error_t *error)
 
     jsonp_error_init(error, path);
 
-    fp = fopen(path, "r");
+    fp = fopen(path, "rb");
     if(!fp)
     {
         error_set(error, NULL, "unable to open %s: %s",