Skip to content

Commit

Permalink
Fix handling of invalid string in chrono formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed May 1, 2019
1 parent b3cc9c0 commit 4a4d72f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,12 @@ struct formatter<std::chrono::duration<Rep, Period>, Char> {

FMT_CONSTEXPR parse_range do_parse(basic_parse_context<Char>& ctx) {
auto begin = ctx.begin(), end = ctx.end();
if (begin == end) return {begin, end};
if (begin == end || *begin == '}') return {begin, begin};
spec_handler handler{*this, ctx, format_str};
begin = internal::parse_align(begin, end, handler);
if (begin == end) return {begin, end};
if (begin == end) return {begin, begin};
begin = internal::parse_width(begin, end, handler);
if (begin == end) return {begin, end};
if (begin == end) return {begin, begin};
if (*begin == '.') {
if (std::is_floating_point<Rep>::value)
begin = internal::parse_precision(begin, end, handler);
Expand Down

0 comments on commit 4a4d72f

Please sign in to comment.