aboutsummaryrefslogtreecommitdiffstats
path: root/src/lyrics_leoslyrics.c
diff options
context:
space:
mode:
authorAndreas Obergrusberger <tradiaz@yahoo.de>2007-06-17 12:19:39 +0000
committerAndreas Obergrusberger <tradiaz@yahoo.de>2007-06-17 12:19:39 +0000
commit8ca4dfdb3e3deaa5246c1e339e773c90d2db7451 (patch)
treeca2596feb714dfe383dcd0825a9261e1570c5fa0 /src/lyrics_leoslyrics.c
parent426c6c4c7fd400cc3bec6d73de36b0ac58e12419 (diff)
downloadmpd-8ca4dfdb3e3deaa5246c1e339e773c90d2db7451.tar.gz
mpd-8ca4dfdb3e3deaa5246c1e339e773c90d2db7451.tar.xz
mpd-8ca4dfdb3e3deaa5246c1e339e773c90d2db7451.zip
2 critical bugs in leoslyrics lyrics src fixed
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@6630 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/lyrics_leoslyrics.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lyrics_leoslyrics.c b/src/lyrics_leoslyrics.c
index 3b85e68d3..4afb3fa7b 100644
--- a/src/lyrics_leoslyrics.c
+++ b/src/lyrics_leoslyrics.c
@@ -50,7 +50,7 @@ static void check_search_response(void *data, const char *name,
{
if(strstr(atts[2], "hid") != NULL)
{
- hid = atts[3];
+ hid = strdup (atts[3]);
}
if(strstr(atts[2], "exactMatch") != NULL)
@@ -120,7 +120,12 @@ int check_lyr_leoslyrics(char *artist, char *title, char *url)
XML_ParserFree(parser);
if(!(result & 4)) return -1; //check whether lyrics found
- snprintf(url, 512, LEOSLYRICS_CONTENT_URL, hid);
+
+ CURL *curl = curl_easy_init ();
+ char *esc_hid = curl_easy_escape (curl, hid, 0);
+ free (hid);
+
+ snprintf(url, 512, LEOSLYRICS_CONTENT_URL, esc_hid);
return 0;
}