Skip to content

Commit

Permalink
Fix asan error (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Dec 12, 2018
1 parent b180b39 commit c222f65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1951,9 +1951,11 @@ FMT_CONSTEXPR const Char *parse_arg_id(
if (!is_name_start(c))
return handler.on_error("invalid format string"), begin;
auto it = begin;
do {
c = *++it;
} while (it != end && (is_name_start(c) || ('0' <= c && c <= '9')));
for (++it; it != end; ++it) {
c = *it;
if (!(is_name_start(c) || ('0' <= c && c <= '9')))
break;
}
handler(basic_string_view<Char>(begin, to_unsigned(it - begin)));
return it;
}
Expand Down

0 comments on commit c222f65

Please sign in to comment.