[libbdplus-devel] use str_dup

anonymous git at videolan.org
Wed Apr 29 10:24:24 CEST 2015


libbdplus | branch: master | anonymous <anonymous at anonymous.org> | Wed Apr 29 11:19:10 2015 +0300| [9d1d7727f8609198072f856c27a71bc495515ca9] | committer: anonymous

use str_dup

> http://git.videolan.org/gitweb.cgi/libbdplus.git/?a=commit;h=9d1d7727f8609198072f856c27a71bc495515ca9
---

 src/file/configfile.c |    2 +-
 src/file/dirs_xdg.c   |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/file/configfile.c b/src/file/configfile.c
index b369fad..81ee476 100644
--- a/src/file/configfile.c
+++ b/src/file/configfile.c
@@ -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 == '/')
diff --git a/src/file/dirs_xdg.c b/src/file/dirs_xdg.c
index c38f710..b9e5c2a 100644
--- a/src/file/dirs_xdg.c
+++ b/src/file/dirs_xdg.c
@@ -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");



More information about the libbdplus-devel mailing list