aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-08 20:45:38 +0200
committerMax Kellermann <max@duempel.org>2009-10-08 20:45:38 +0200
commit128a5fa4a599b72e6cb9c9f3954aec62dd3b3181 (patch)
tree5364277b05b9e98e636e76513e00dcf4015c2c3b /src/command.c
parenta5960c20cc679132e049fc6da0f3d7d6fa34e361 (diff)
downloadmpd-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.c7
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);