File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ class scoped_padder {
70
70
pad_it (remaining_pad_);
71
71
} else if (padinfo_.truncate_ ) {
72
72
long new_size = static_cast <long >(dest_.size ()) + remaining_pad_;
73
+ if (new_size < 0 ) {
74
+ new_size = 0 ;
75
+ }
73
76
dest_.resize (static_cast <size_t >(new_size));
74
77
}
75
78
}
@@ -264,7 +267,7 @@ class D_formatter final : public flag_formatter {
264
267
: flag_formatter(padinfo) {}
265
268
266
269
void format (const details::log_msg &, const std::tm &tm_time, memory_buf_t &dest) override {
267
- const size_t field_size = 10 ;
270
+ const size_t field_size = 8 ;
268
271
ScopedPadder p (field_size, padinfo_, dest);
269
272
270
273
fmt_helper::pad2 (tm_time.tm_mon + 1 , dest);
@@ -926,9 +929,8 @@ class full_formatter final : public flag_formatter {
926
929
memory_buf_t cached_datetime_;
927
930
928
931
#ifndef SPDLOG_NO_TLS
929
- mdc_formatter<null_scoped_padder> mdc_formatter_{padding_info{}};
932
+ mdc_formatter<null_scoped_padder> mdc_formatter_{padding_info {}};
930
933
#endif
931
-
932
934
};
933
935
934
936
} // namespace details
You can’t perform that action at this time.
0 commit comments