Commit e89c271f authored by anonymous's avatar anonymous
Browse files

Merge changes from other libs

parent b90f6671
......@@ -171,6 +171,11 @@ static char *_load_fp(FILE *fp, uint32_t *p_size)
}
data = malloc(file_size + 1);
if (!data) {
BD_DEBUG(DBG_FILE, "Out of memory\n");
return NULL;
}
read_size = fread(data, 1, file_size, fp);
if (read_size != file_size) {
......
......@@ -73,23 +73,10 @@ char *file_get_cache_home(void)
const char *file_get_config_system(const char *dir)
{
static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0"
if (!dirs) {
dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0);
}
if (!dir) {
// first call
dir = dirs;
} else {
// next call
dir += strlen(dir) + 1;
if (!*dir) {
// end of list
dir = NULL;
}
return SYSTEM_CFG_DIR;
}
return dir;
return NULL;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment