Fix buffer overflow

This commit is contained in:
Shawn Zhong 2023-01-14 01:23:44 -06:00
parent 5dc570cc0e
commit 64951f1295

View File

@ -705,8 +705,9 @@ FMT_CONSTEXPR const Char* parse_chrono_format(const Char* begin,
continue;
}
if (begin != ptr) handler.on_text(begin, ptr);
c = *++ptr; // consume '%'
++ptr; // consume '%'
if (ptr == end) FMT_THROW(format_error("invalid format"));
c = *ptr;
switch (c) {
case '_':
pad = pad_type::space;