Commit 9d1d7727 authored by anonymous's avatar anonymous
Browse files

use str_dup

parent 9821ee45
......@@ -50,7 +50,7 @@ int file_mkpath(const char *path)
{
struct stat s;
int result = 1;
char *dir = str_printf("%s", path);
char *dir = str_dup(path);
char *end = dir;
while (*end == '/')
......
......@@ -45,7 +45,7 @@ char *file_get_config_home(void)
{
const char *xdg_home = getenv("XDG_CONFIG_HOME");
if (xdg_home && *xdg_home) {
return str_printf("%s", xdg_home);
return str_dup(xdg_home);
}
const char *user_home = getenv("HOME");
......@@ -61,7 +61,7 @@ char *file_get_data_home(void)
{
const char *xdg_home = getenv("XDG_DATA_HOME");
if (xdg_home && *xdg_home) {
return str_printf("%s", xdg_home);
return str_dup(xdg_home);
}
const char *user_home = getenv("HOME");
......@@ -77,7 +77,7 @@ char *file_get_cache_home(void)
{
const char *xdg_cache = getenv("XDG_CACHE_HOME");
if (xdg_cache && *xdg_cache) {
return str_printf("%s", xdg_cache);
return str_dup(xdg_cache);
}
const char *user_home = getenv("HOME");
......
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