From 9c866afab8308a58ce03555a61daa4380c09d73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 18 Dec 2007 20:59:29 +0100 Subject: Use zeroed allocation instead of memset, and don't zero out a string that is going to be fully sprintf'd. --- src/input/input_cdda.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 8929a8af7..e658e30ca 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1287,15 +1287,12 @@ static void _cdda_mkdir_safe(xine_t *xine, char *path) { */ static void _cdda_mkdir_recursive_safe(xine_t *xine, char *path) { char *p, *pp; - char buf[XINE_PATH_MAX + XINE_NAME_MAX + 1]; - char buf2[XINE_PATH_MAX + XINE_NAME_MAX + 1]; + char buf[XINE_PATH_MAX + XINE_NAME_MAX + 1] = { 0, }; + char buf2[XINE_PATH_MAX + XINE_NAME_MAX + 1] = { 0, }; if(path == NULL) return; - memset(&buf, 0, sizeof(buf)); - memset(&buf2, 0, sizeof(buf2)); - snprintf(buf, sizeof(buf), "%s", path); pp = buf; while((p = xine_strsep(&pp, "/")) != NULL) { @@ -1438,7 +1435,6 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) { while((pdir = readdir(dir)) != NULL) { char discid[9]; - memset(&discid, 0, sizeof(discid)); snprintf(discid, sizeof(discid), "%08lx", this->cddb.disc_id); if(!strcasecmp(pdir->d_name, discid)) { -- cgit v1.2.3