json_dump_file: Open the output file in wb mode
authorPetri Lehtinen <petri@digip.org>
Fri, 7 Oct 2011 17:52:49 +0000 (20:52 +0300)
committerPetri Lehtinen <petri@digip.org>
Fri, 7 Oct 2011 17:52:54 +0000 (20:52 +0300)
For maximum compatibility.

src/dump.c

index d87d5c7..33112ba 100644 (file)
@@ -425,7 +425,7 @@ int json_dump_file(const json_t *json, const char *path, size_t flags)
 {
     int result;
 
-    FILE *output = fopen(path, "w");
+    FILE *output = fopen(path, "wb");
     if(!output)
         return -1;