From 4954fde9c7c7bb6644521dec0e43feb532f8ca42 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 10 Jun 2008 21:44:51 +0200 Subject: Xml encode new name in PianoRenameStation --- libpiano/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libpiano') 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), "" "station.setStationName" "%li" @@ -290,7 +291,7 @@ PianoReturn_t PianoRenameStation (PianoHandle_t *ph, PianoStation_t *station, "%s" "%s" "", 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); -- cgit v1.2.3