a/util: Read config files in binary mode to fix on Windows

This commit is contained in:
Meng Jiao 2024-03-04 10:39:27 +08:00 committed by Rylie Pavlik
parent 6fddf3103d
commit fec1d42139
2 changed files with 2 additions and 2 deletions

View file

@ -54,7 +54,7 @@ u_config_json_open_or_create_file(struct u_config_json *json, const char *filena
return;
}
FILE *file = u_file_open_file_in_config_dir(filename, "r");
FILE *file = u_file_open_file_in_config_dir(filename, "rb");
if (file == NULL) {
return;
}

View file

@ -245,7 +245,7 @@ u_file_read_content(FILE *file)
char *
u_file_read_content_from_path(const char *path)
{
FILE *file = fopen(path, "r");
FILE *file = fopen(path, "rb");
if (file == NULL) {
return NULL;
}