[fix] open files in binary format for #69

This commit is contained in:
Al
2017-05-03 17:34:38 -04:00
parent 6ea2273263
commit cea3ced533
2 changed files with 3 additions and 3 deletions

View File

@@ -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_array_add_joined(path, PATH_SEPARATOR, true, 2, dir, ADDRESS_PARSER_PHRASE_FILENAME);
char *phrases_path = char_array_get_string(path); 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) { if (phrases_file == NULL) {
goto exit_address_parser_created; goto exit_address_parser_created;
} }
@@ -269,7 +269,7 @@ bool address_parser_load(char *dir) {
char *postal_codes_path = char_array_get_string(path); 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) { if (postal_codes_file == NULL) {
goto exit_address_parser_created; goto exit_address_parser_created;
} }

View File

@@ -1110,7 +1110,7 @@ exit_file_read:
trie_t *trie_load(char *path) { trie_t *trie_load(char *path) {
FILE *file; FILE *file;
file = fopen(path, "r"); file = fopen(path, "rb");
if (!file) if (!file)
return NULL; return NULL;