From cea3ced5334f4626043d6bf3f0c794299b842822 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 3 May 2017 17:34:38 -0400 Subject: [PATCH] [fix] open files in binary format for #69 --- src/address_parser.c | 4 ++-- src/trie.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/address_parser.c b/src/address_parser.c index b8c935e4..7e6de097 100644 --- a/src/address_parser.c +++ b/src/address_parser.c @@ -228,7 +228,7 @@ bool address_parser_load(char *dir) { char_array_add_joined(path, PATH_SEPARATOR, true, 2, dir, ADDRESS_PARSER_PHRASE_FILENAME); char *phrases_path = char_array_get_string(path); - FILE *phrases_file = fopen(phrases_path, "r"); + FILE *phrases_file = fopen(phrases_path, "rb"); if (phrases_file == NULL) { goto exit_address_parser_created; } @@ -269,7 +269,7 @@ bool address_parser_load(char *dir) { char *postal_codes_path = char_array_get_string(path); - FILE *postal_codes_file = fopen(postal_codes_path, "r"); + FILE *postal_codes_file = fopen(postal_codes_path, "rb"); if (postal_codes_file == NULL) { goto exit_address_parser_created; } diff --git a/src/trie.c b/src/trie.c index 35b4254c..2e11ba6e 100644 --- a/src/trie.c +++ b/src/trie.c @@ -1110,7 +1110,7 @@ exit_file_read: trie_t *trie_load(char *path) { FILE *file; - file = fopen(path, "r"); + file = fopen(path, "rb"); if (!file) return NULL;