Revert "json_dump_file: Open the output file in wb mode"
authorPetri Lehtinen <petri@digip.org>
Mon, 14 Nov 2011 19:15:17 +0000 (21:15 +0200)
committerPetri Lehtinen <petri@digip.org>
Mon, 14 Nov 2011 19:16:36 +0000 (21:16 +0200)
JSON is read as text, so line endings should be preserved.

This reverts commit 32cd82127390b9fd5b5d090bc3c279d3e4d9f3a6.

src/dump.c

index 089474d..37f5a40 100644 (file)
@@ -427,7 +427,7 @@ int json_dump_file(const json_t *json, const char *path, size_t flags)
 {
     int result;
 
-    FILE *output = fopen(path, "wb");
+    FILE *output = fopen(path, "w");
     if(!output)
         return -1;