Commit dd5e6327 authored by Petri Hintukainen's avatar Petri Hintukainen

use str_dup()

parent e0b0a544
......@@ -44,7 +44,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");
......@@ -60,7 +60,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");
......@@ -76,7 +76,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