diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 21:44:51 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 21:44:51 +0200 |
commit | 4954fde9c7c7bb6644521dec0e43feb532f8ca42 (patch) | |
tree | e1a8a0df2a4d8b9b82c4d41ba6456b5698013e8e /libpiano | |
parent | a83e76cc7021ef475f1b8a2f52f20f690d65fe4f (diff) | |
download | pianobar-4954fde9c7c7bb6644521dec0e43feb532f8ca42.tar.gz pianobar-4954fde9c7c7bb6644521dec0e43feb532f8ca42.tar.bz2 pianobar-4954fde9c7c7bb6644521dec0e43feb532f8ca42.zip |
Xml encode new name in PianoRenameStation
Diffstat (limited to 'libpiano')
-rw-r--r-- | libpiano/main.c | 6 |
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); |