player_control: allocate getPlayerErrorStr() result

This lets us eliminate the static fixed-size buffer.
This commit is contained in:
Max Kellermann
2009-10-08 20:45:38 +02:00
parent a5960c20cc
commit 128a5fa4a5
3 changed files with 23 additions and 21 deletions

View File

@@ -454,6 +454,7 @@ handle_status(struct client *client,
{
const char *state = NULL;
int updateJobId;
char *error;
int song;
switch (getPlayerState()) {
@@ -515,10 +516,12 @@ handle_status(struct client *client,
updateJobId);
}
if (getPlayerError() != PLAYER_ERROR_NOERROR) {
error = getPlayerErrorStr();
if (error != NULL) {
client_printf(client,
COMMAND_STATUS_ERROR ": %s\n",
getPlayerErrorStr());
error);
g_free(error);
}
song = playlist_get_next_song(&g_playlist);