mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
use rb mode reported at https://github.com/lionsoul2014/ip2region/issues/255
This commit is contained in:
parent
e2aebce0a7
commit
3641d130d0
@ -23,7 +23,7 @@ XDB_PRIVATE(int) xdb_new_base(xdb_searcher_t *xdb, const char *db_path, const xd
|
||||
}
|
||||
|
||||
// open the xdb binary file
|
||||
FILE *handle = fopen(db_path, "r");
|
||||
FILE *handle = fopen(db_path, "rb");
|
||||
if (handle == NULL) {
|
||||
return 1;
|
||||
}
|
||||
@ -206,7 +206,7 @@ XDB_PUBLIC(xdb_header_t *) xdb_load_header(FILE *handle) {
|
||||
|
||||
XDB_PUBLIC(xdb_header_t *) xdb_load_header_from_file(const char *db_path) {
|
||||
xdb_header_t *header;
|
||||
FILE *handle = fopen(db_path, "r");
|
||||
FILE *handle = fopen(db_path, "rb");
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@ -252,7 +252,7 @@ XDB_PUBLIC(xdb_vector_index_t *) xdb_load_vector_index(FILE *handle) {
|
||||
|
||||
XDB_PUBLIC(xdb_vector_index_t *) xdb_load_vector_index_from_file(const char *db_path) {
|
||||
xdb_vector_index_t *v_index;
|
||||
FILE *handle = fopen(db_path, "r");
|
||||
FILE *handle = fopen(db_path, "rb");
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@ -311,7 +311,7 @@ XDB_PUBLIC(xdb_content_t *) xdb_load_content(FILE *handle) {
|
||||
|
||||
XDB_PUBLIC(xdb_content_t *) xdb_load_content_from_file(const char *db_path) {
|
||||
xdb_content_t *content;
|
||||
FILE *handle = fopen(db_path, "r");
|
||||
FILE *handle = fopen(db_path, "rb");
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user