aboutsummaryrefslogtreecommitdiffstats
path: root/src/lyrics_leoslyrics.c
diff options
context:
space:
mode:
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;
}