client/Response: reimplement Error() without FmtError()
With libfmt versions older than 7, this leads to an endless recursion between Error() and FmtError(), resulting in a crash due to stack overflow. D'oh! Closes https://github.com/MusicPlayerDaemon/MPD/issues/1295
This commit is contained in:
parent
6120c1360c
commit
fd5a3b5880
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
||||||
ver 0.23.2 (not yet released)
|
ver 0.23.2 (not yet released)
|
||||||
* neighbor
|
* neighbor
|
||||||
- mention failed plugin name in error message
|
- mention failed plugin name in error message
|
||||||
|
* fix crash with libfmt versions older than 7
|
||||||
|
|
||||||
ver 0.23.1 (2021/10/19)
|
ver 0.23.1 (2021/10/19)
|
||||||
* protocol
|
* protocol
|
||||||
|
|
|
@ -66,7 +66,11 @@ Response::WriteBinary(ConstBuffer<void> payload) noexcept
|
||||||
void
|
void
|
||||||
Response::Error(enum ack code, const char *msg) noexcept
|
Response::Error(enum ack code, const char *msg) noexcept
|
||||||
{
|
{
|
||||||
FmtError(code, FMT_STRING("{}"), msg);
|
Fmt(FMT_STRING("ACK [{}@{}] {{{}}} "),
|
||||||
|
(int)code, list_index, command);
|
||||||
|
|
||||||
|
Write(msg);
|
||||||
|
Write("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue