From d78ddd1e50dae2038a0d3f742d45e17dee0bbe4b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 26 Mar 2008 10:38:34 +0000 Subject: wavpack_plugin: cleanups after the last commit * malloc() => xmalloc() for error checking * strncpy() replaced with memcpy(), memcpy appears perfectly safe here and mpd does not ever use strncpy() (see r4491) git-svn-id: https://svn.musicpd.org/mpd/trunk@7211 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugins/wavpack_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/inputPlugins/wavpack_plugin.c') diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c index 8f0685aa2..e25b5099c 100644 --- a/src/inputPlugins/wavpack_plugin.c +++ b/src/inputPlugins/wavpack_plugin.c @@ -468,12 +468,12 @@ static int wavpack_streamdecode(OutputBuffer *cb, DecoderControl *dc, break; } - wvc_url = (char *)malloc(len + 2); /* +2: 'c' and EOS */ + wvc_url = (char *)xmalloc(len + 2); /* +2: 'c' and EOS */ if (wvc_url == NULL) { break; } - strncpy(wvc_url, dc->utf8url, len); + memcpy(wvc_url, dc->utf8url, len); wvc_url[len] = 'c'; wvc_url[len + 1] = '\0'; -- cgit v1.2.3