Commit d78ddd1e authored by Eric Wong's avatar Eric Wong

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
parent ad0d350f
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment