use rb mode reported at https://github.com/lionsoul2014/ip2region/issues/255
This commit is contained in:
parent
17b22f6907
commit
528d4bb577
|
|
@ -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
|
// open the xdb binary file
|
||||||
FILE *handle = fopen(db_path, "r");
|
FILE *handle = fopen(db_path, "rb");
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
return 1;
|
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_PUBLIC(xdb_header_t *) xdb_load_header_from_file(const char *db_path) {
|
||||||
xdb_header_t *header;
|
xdb_header_t *header;
|
||||||
FILE *handle = fopen(db_path, "r");
|
FILE *handle = fopen(db_path, "rb");
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
return 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_PUBLIC(xdb_vector_index_t *) xdb_load_vector_index_from_file(const char *db_path) {
|
||||||
xdb_vector_index_t *v_index;
|
xdb_vector_index_t *v_index;
|
||||||
FILE *handle = fopen(db_path, "r");
|
FILE *handle = fopen(db_path, "rb");
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
return 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_PUBLIC(xdb_content_t *) xdb_load_content_from_file(const char *db_path) {
|
||||||
xdb_content_t *content;
|
xdb_content_t *content;
|
||||||
FILE *handle = fopen(db_path, "r");
|
FILE *handle = fopen(db_path, "rb");
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue