Check chrono spec starts with %

This commit is contained in:
Shawn Zhong
2022-12-21 14:40:30 -08:00
committed by Victor Zverovich
parent 115001a3b1
commit 8c56919bd2
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -626,6 +626,8 @@ template <typename Char, typename Handler>
FMT_CONSTEXPR const Char* parse_chrono_format(const Char* begin,
const Char* end,
Handler&& handler) {
if (begin == end || *begin == '}') return begin;
if (*begin != '%') FMT_THROW(format_error("invalid format"));
auto ptr = begin;
while (ptr != end) {
auto c = *ptr;