diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-24 12:52:43 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-24 13:28:28 +0100 |
commit | 97f670658fb0ab21d469eb69510faa8403c99d65 (patch) | |
tree | 4925c68092e81c2839afc85855de37d98e8273aa /src/protocol | |
parent | 4324fb2fbed32533d8efa8c211038ef8fe0b9a0e (diff) |
util/StringFormat: new utility library
Diffstat (limited to 'src/protocol')
-rw-r--r-- | src/protocol/Ack.hxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/protocol/Ack.hxx b/src/protocol/Ack.hxx index 195f4bcb0..497f85b18 100644 --- a/src/protocol/Ack.hxx +++ b/src/protocol/Ack.hxx @@ -20,9 +20,9 @@ #ifndef MPD_ACK_H #define MPD_ACK_H -#include <stdexcept> +#include "util/StringFormat.hxx" -#include <stdio.h> +#include <stdexcept> class Domain; @@ -60,9 +60,9 @@ template<typename... Args> static inline ProtocolError FormatProtocolError(enum ack code, const char *fmt, Args&&... args) noexcept { - char buffer[256]; - snprintf(buffer, sizeof(buffer), fmt, std::forward<Args>(args)...); - return ProtocolError(code, buffer); + return ProtocolError(code, + StringFormat<256>(fmt, + std::forward<Args>(args)...)); } #endif |