aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-07-13 21:10:06 +0000
committerKalle Wallin <kaw@linux.se>2004-07-13 21:10:06 +0000
commit9a500d13055f16b70796a5fce5ec6de4a2844187 (patch)
tree8f57c14c8454ee836597cc47ed7eedd3b6f4dabe /src/utils.c
parente9f21b11c862ad168bb5a850730861e01ad6f3d8 (diff)
downloadmpd-9a500d13055f16b70796a5fce5ec6de4a2844187.tar.gz
mpd-9a500d13055f16b70796a5fce5ec6de4a2844187.tar.xz
mpd-9a500d13055f16b70796a5fce5ec6de4a2844187.zip
Use glib's str functions (g_strlcat, g_strlcpy, g_snprintf, g_strdup_vprintf)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1868 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c
index 58340c42e..0f63ff1da 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -101,10 +101,11 @@ gcmp_list_from_path(mpdclient_t *c, gchar *path, GList *list, gint types)
{
mpd_Directory *dir = entity->info.directory;
gchar *tmp = utf8_to_locale(dir->path);
+ gsize size = strlen(tmp)+2;
- name = g_malloc(strlen(tmp)+2);
- strcpy(name, tmp);
- strcat(name, "/");
+ name = g_malloc(size);
+ g_strlcpy(name, tmp, size);
+ g_strlcat(name, "/", size);
g_free(tmp);
}
else if( entity && entity->type==MPD_INFO_ENTITY_TYPE_SONG &&