summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-24 12:52:43 +0100
committerMax Kellermann <max@musicpd.org>2018-07-06 19:07:02 +0200
commit60d5bf0240dea58419edb05198906349e81abbe8 (patch)
tree3811d24f1ec17257b14d7dd8759a6948ac676399 /src/lib
parent41cdc4e14b3d36d70039a7ac1578fe7c898a0bac (diff)
util/StringFormat: new utility library
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg/LogCallback.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/ffmpeg/LogCallback.cxx b/src/lib/ffmpeg/LogCallback.cxx
index c682da63d..5a0fa4a6f 100644
--- a/src/lib/ffmpeg/LogCallback.cxx
+++ b/src/lib/ffmpeg/LogCallback.cxx
@@ -25,6 +25,7 @@
#include "Domain.hxx"
#include "LogV.hxx"
#include "util/Domain.hxx"
+#include "util/StringFormat.hxx"
extern "C" {
#include <libavutil/log.h>
@@ -57,9 +58,10 @@ FfmpegLogCallback(gcc_unused void *ptr, int level, const char *fmt, va_list vl)
cls = *(const AVClass *const*)ptr;
if (cls != nullptr) {
- char domain[64];
- snprintf(domain, sizeof(domain), "%s/%s",
- ffmpeg_domain.GetName(), cls->item_name(ptr));
+ const auto domain =
+ StringFormat<64>("%s/%s",
+ ffmpeg_domain.GetName(),
+ cls->item_name(ptr));
const Domain d(domain);
LogFormatV(d, FfmpegImportLogLevel(level), fmt, vl);
}