summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-10 21:44:51 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-10 21:44:51 +0200
commit4954fde9c7c7bb6644521dec0e43feb532f8ca42 (patch)
treee1a8a0df2a4d8b9b82c4d41ba6456b5698013e8e
parenta83e76cc7021ef475f1b8a2f52f20f690d65fe4f (diff)
downloadpianobar-windows-4954fde9c7c7bb6644521dec0e43feb532f8ca42.tar.gz
pianobar-windows-4954fde9c7c7bb6644521dec0e43feb532f8ca42.tar.bz2
pianobar-windows-4954fde9c7c7bb6644521dec0e43feb532f8ca42.zip
Xml encode new name in PianoRenameStation
-rw-r--r--libpiano/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpiano/main.c b/libpiano/main.c
index 1ee3f2b..7e9b129 100644
--- a/libpiano/main.c
+++ b/libpiano/main.c
@@ -280,9 +280,10 @@ PianoReturn_t PianoRateTrack (PianoHandle_t *ph, PianoStation_t *station,
PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station,
char *newName) {
char xmlSendBuf[10000], url[PIANO_URL_BUFFER_SIZE];
- char *requestStr, *retStr, *urlencodedNewName;
+ char *requestStr, *retStr, *urlencodedNewName, *xmlencodedNewName;
PianoReturn_t ret = PIANO_RET_ERR;
+ xmlencodedNewName = PianoXmlEncodeString (newName);
snprintf (xmlSendBuf, sizeof (xmlSendBuf), "<?xml version=\"1.0\"?>"
"<methodCall><methodName>station.setStationName</methodName>"
"<params><param><value><int>%li</int></value></param>"
@@ -290,7 +291,7 @@ PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station,
"<param><value><string>%s</string></value></param>"
"<param><value><string>%s</string></value></param>"
"</params></methodCall>", time (NULL), ph->user.authToken,
- station->id, /* FIXME: xml-encode this */ newName);
+ station->id, xmlencodedNewName);
requestStr = PianoEncryptString (xmlSendBuf);
urlencodedNewName = curl_easy_escape (ph->curlHandle, newName, 0);
@@ -301,6 +302,7 @@ PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station,
ret = PianoXmlParseSimple (retStr);
curl_free (urlencodedNewName);
+ free (xmlencodedNewName);
free (requestStr);
free (retStr);