From: Max Kellermann Date: Tue, 21 Mar 2017 21:36:27 +0000 (+0100) Subject: db_completion: use g_strconcat() X-Git-Tag: v0.27~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2b171daac0ab6ac161514aeaa521fdd51e3f09c6;p=ncmpc.git db_completion: use g_strconcat() --- diff --git a/src/db_completion.c b/src/db_completion.c index 739e145..025b426 100644 --- a/src/db_completion.c +++ b/src/db_completion.c @@ -21,8 +21,6 @@ #include "charset.h" #include "mpdclient.h" -#include - GList * gcmp_list_from_path(struct mpdclient *c, const gchar *path, GList *list, gint types) @@ -42,11 +40,7 @@ gcmp_list_from_path(struct mpdclient *c, const gchar *path, const struct mpd_directory *dir = mpd_entity_get_directory(entity); gchar *tmp = utf8_to_locale(mpd_directory_get_path(dir)); - gsize size = strlen(tmp)+2; - - name = g_malloc(size); - g_strlcpy(name, tmp, size); - g_strlcat(name, "/", size); + name = g_strconcat(tmp, "/", NULL); g_free(tmp); } else if (mpd_entity_get_type(entity) == MPD_ENTITY_TYPE_SONG && types & GCMP_TYPE_FILE) {