diff options
author | Max Kellermann <max@duempel.org> | 2009-10-08 20:45:38 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-10-08 20:45:38 +0200 |
commit | 128a5fa4a599b72e6cb9c9f3954aec62dd3b3181 (patch) | |
tree | 5364277b05b9e98e636e76513e00dcf4015c2c3b /src/command.c | |
parent | a5960c20cc679132e049fc6da0f3d7d6fa34e361 (diff) | |
download | mpd-128a5fa4a599b72e6cb9c9f3954aec62dd3b3181.tar.gz mpd-128a5fa4a599b72e6cb9c9f3954aec62dd3b3181.tar.xz mpd-128a5fa4a599b72e6cb9c9f3954aec62dd3b3181.zip |
player_control: allocate getPlayerErrorStr() result
This lets us eliminate the static fixed-size buffer.
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c index 165e21c96..c48ea845d 100644 --- a/src/command.c +++ b/src/command.c @@ -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); |