diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 12:14:28 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 12:14:28 +0200 |
commit | 305a4ba4885038f05444b9a7e8664c6ff67b66e2 (patch) | |
tree | 5339c06443daf7bd08157e77883fe26f4bfc3427 /libpiano | |
parent | f9bc1869e6fcba8f681d38dffa51661a3d87b005 (diff) | |
download | pianobar-305a4ba4885038f05444b9a7e8664c6ff67b66e2.tar.gz pianobar-305a4ba4885038f05444b9a7e8664c6ff67b66e2.tar.bz2 pianobar-305a4ba4885038f05444b9a7e8664c6ff67b66e2.zip |
Replaced strcmp with xmlStrEqual
We're dealing with data from libxml2, so use its functions.
Diffstat (limited to 'libpiano')
-rw-r--r-- | libpiano/xml.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libpiano/xml.c b/libpiano/xml.c index ba6e3c8..119e213 100644 --- a/libpiano/xml.c +++ b/libpiano/xml.c @@ -99,11 +99,11 @@ void PianoXmlParseUserinfoCb (char *key, xmlNode *value, void *data) { valueStr = (char *) value->children->content; } /* FIXME: should be continued later */ - if (strcmp ("webAuthToken", key) == 0) { + if (xmlStrEqual ("webAuthToken", key)) { user->webAuthToken = strdup (valueStr); - } else if (strcmp ("authToken", key) == 0) { + } else if (xmlStrEqual ("authToken", key)) { user->authToken = strdup (valueStr); - } else if (strcmp ("listenerId", key) == 0) { + } else if (xmlStrEqual ("listenerId", key)) { user->listenerId = strdup (valueStr); } } @@ -121,9 +121,9 @@ void PianoXmlParseStationsCb (char *key, xmlNode *value, void *data) { value->children->content != NULL) { valueStr = (char *) value->children->content; } - if (strcmp ("stationName", key) == 0) { + if (xmlStrEqual ("stationName", key)) { station->name = strdup (valueStr); - } else if (strcmp ("stationId", key) == 0) { + } else if (xmlStrEqual ("stationId", key)) { station->id = strdup (valueStr); } } @@ -141,7 +141,7 @@ void PianoXmlParsePlaylistCb (char *key, xmlNode *value, void *data) { value->children->content != NULL) { valueStr = (char *) value->children->content; } - if (strcmp ("audioURL", key) == 0) { + if (xmlStrEqual ("audioURL", key)) { /* last 48 chars of audioUrl are encrypted, but they put the key * into the door's lock; dumb pandora... */ const char urlTailN = 48; @@ -155,19 +155,19 @@ void PianoXmlParsePlaylistCb (char *key, xmlNode *value, void *data) { strncat (song->audioUrl, urlTail, (urlTailN/2)-8); free (urlTail); - } else if (strcmp ("artistSummary", key) == 0) { + } else if (xmlStrEqual ("artistSummary", key)) { song->artist = strdup (valueStr); - } else if (strcmp ("musicId", key) == 0) { + } else if (xmlStrEqual ("musicId", key)) { song->musicId = strdup (valueStr); - } else if (strcmp ("matchingSeed", key) == 0) { + } else if (xmlStrEqual ("matchingSeed", key)) { song->matchingSeed = strdup (valueStr); - } else if (strcmp ("userSeed", key) == 0) { + } else if (xmlStrEqual ("userSeed", key)) { song->userSeed = strdup (valueStr); - } else if (strcmp ("focusTraitId", key) == 0) { + } else if (xmlStrEqual ("focusTraitId", key)) { song->focusTraitId = strdup (valueStr); - } else if (strcmp ("songTitle", key) == 0) { + } else if (xmlStrEqual ("songTitle", key)) { song->title = strdup (valueStr); - } else if (strcmp ("rating", key) == 0) { + } else if (xmlStrEqual ("rating", key)) { if (xmlStrEqual (valueStr, "1")) { song->rating = PIANO_RATE_LOVE; } else { |