diff options
author | Max Kellermann <max@duempel.org> | 2013-10-17 19:37:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-17 19:39:23 +0200 |
commit | c85af12d45928aecb20a087a009e1f5f19f980e2 (patch) | |
tree | 1f9fa24bcd5b5e795b4651e30fe3283c42d9b4a2 /src/StickerCommands.cxx | |
parent | e452d1f5b42fac9acdd4d8e5d86eb28b73a3bbc6 (diff) | |
download | mpd-c85af12d45928aecb20a087a009e1f5f19f980e2.tar.gz mpd-c85af12d45928aecb20a087a009e1f5f19f980e2.tar.xz mpd-c85af12d45928aecb20a087a009e1f5f19f980e2.zip |
StickerDatabase: return std::string
Diffstat (limited to 'src/StickerCommands.cxx')
-rw-r--r-- | src/StickerCommands.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/StickerCommands.cxx b/src/StickerCommands.cxx index 5fdc0ba15..4c2152789 100644 --- a/src/StickerCommands.cxx +++ b/src/StickerCommands.cxx @@ -65,16 +65,15 @@ handle_sticker_song(Client *client, int argc, char *argv[]) if (song == nullptr) return print_error(client, error); - char *value = sticker_song_get_value(song, argv[4]); + const auto value = sticker_song_get_value(song, argv[4]); db->ReturnSong(song); - if (value == NULL) { + if (value.empty()) { command_error(client, ACK_ERROR_NO_EXIST, "no such sticker"); return COMMAND_RETURN_ERROR; } - sticker_print_value(client, argv[4], value); - g_free(value); + sticker_print_value(client, argv[4], value.c_str()); return COMMAND_RETURN_OK; /* list song song_id */ |