mirror of
https://github.com/gabime/spdlog.git
synced 2026-04-10 11:34:29 +08:00
Fix warning
This commit is contained in:
@@ -525,16 +525,15 @@ public:
|
|||||||
void format(const details::log_msg &msg, const std::tm &tm_time, memory_buf_t &dest) override {
|
void format(const details::log_msg &msg, const std::tm &tm_time, memory_buf_t &dest) override {
|
||||||
const size_t field_size = 6;
|
const size_t field_size = 6;
|
||||||
ScopedPadder p(field_size, padinfo_, dest);
|
ScopedPadder p(field_size, padinfo_, dest);
|
||||||
|
|
||||||
if (time_type_ == pattern_time_type::utc) {
|
|
||||||
dest.append("+00:00", "+00:00" + 6);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SPDLOG_NO_TZ_OFFSET
|
#ifdef SPDLOG_NO_TZ_OFFSET
|
||||||
const char *str = "+??:??";
|
const char *str = "+??:??";
|
||||||
dest.append(str, str + 6);
|
dest.append(str, str + 6);
|
||||||
#else
|
#else
|
||||||
|
if (time_type_ == pattern_time_type::utc) {
|
||||||
|
const char *zeroes = "+00:00";
|
||||||
|
dest.append(zeroes, zeroes + 6);
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto total_minutes = get_cached_offset(msg, tm_time);
|
auto total_minutes = get_cached_offset(msg, tm_time);
|
||||||
bool is_negative = total_minutes < 0;
|
bool is_negative = total_minutes < 0;
|
||||||
if (is_negative) {
|
if (is_negative) {
|
||||||
|
|||||||
Reference in New Issue
Block a user