From c23430b438e9740419375205eadbcd84360e40f0 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 10 Jul 2021 14:31:56 +0300 Subject: [PATCH] Fixed cast warning --- include/spdlog/sinks/dup_filter_sink.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index 0a71f0f7..282163ae 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -62,10 +62,10 @@ protected: // log the "skipped.." message if (skip_counter_ > 0) - { + { char buf[64]; auto msg_size = ::snprintf(buf, sizeof(buf), "Skipped %u duplicate messages..", static_cast(skip_counter_)); - if (msg_size > 0 && msg_size < sizeof(buf)) + if (msg_size > 0 && static_cast(msg_size) < sizeof(buf)) { details::log_msg skipped_msg{msg.logger_name, level::info, string_view_t{buf, static_cast(msg_size)}}; dist_sink::sink_it_(skipped_msg);