summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2010-07-31 18:12:48 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-07-31 18:12:48 +0200
commitb01e650546075f574068d89eb58101a88a8f5ed2 (patch)
tree1150b7ea5d147315e07efa4eae9bfd8fed500d58 /src
parent1dac515822e85646c2539d2c6261a9c55b6802ab (diff)
downloadpianobar-b01e650546075f574068d89eb58101a88a8f5ed2.tar.gz
pianobar-b01e650546075f574068d89eb58101a88a8f5ed2.tar.bz2
pianobar-b01e650546075f574068d89eb58101a88a8f5ed2.zip
Fix genre station NULL pointer dereference
Obviously pandora changed the genre station api. Attention: Incompatible libpiano abi change.
Diffstat (limited to 'src')
-rw-r--r--src/ui.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ui.c b/src/ui.c
index 0254089..4329a4e 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -445,7 +445,7 @@ void BarStationFromGenre (PianoHandle_t *ph, WaitressHandle_t *waith, FILE *curF
PianoReturn_t pRet;
WaitressReturn_t wRet;
PianoGenreCategory_t *curCat;
- PianoStation_t *curStation;
+ PianoGenre_t *curGenre;
PianoRequestDataCreateStation_t reqData;
int i;
@@ -481,26 +481,26 @@ void BarStationFromGenre (PianoHandle_t *ph, WaitressHandle_t *waith, FILE *curF
}
/* print all available stations */
- curStation = curCat->stations;
+ curGenre = curCat->genres;
i = 0;
- while (curStation != NULL) {
- BarUiMsg (MSG_LIST, "%2i) %s\n", i, curStation->name);
+ while (curGenre != NULL) {
+ BarUiMsg (MSG_LIST, "%2i) %s\n", i, curGenre->name);
i++;
- curStation = curStation->next;
+ curGenre = curGenre->next;
}
BarUiMsg (MSG_QUESTION, "Select genre: ");
if (BarReadlineInt (&i, curFd) == 0) {
return;
}
- curStation = curCat->stations;
- while (curStation != NULL && i > 0) {
- curStation = curStation->next;
+ curGenre = curCat->genres;
+ while (curGenre != NULL && i > 0) {
+ curGenre = curGenre->next;
i--;
}
/* create station */
- BarUiMsg (MSG_INFO, "Adding shared station \"%s\"... ", curStation->name);
- reqData.id = curStation->id;
- reqData.type = "sh";
+ BarUiMsg (MSG_INFO, "Adding shared station \"%s\"... ", curGenre->name);
+ reqData.id = curGenre->musicId;
+ reqData.type = "mi";
BarUiPianoCall (ph, PIANO_REQUEST_CREATE_STATION, waith, &reqData, &pRet,
&wRet);
}