Skip to content

Commit

Permalink
move error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
js324 committed Mar 6, 2024
1 parent 645fde4 commit 5151ee4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,12 @@ struct range_formatter<
is_debug = true;
set_brackets({}, {});
++it;
if (it == end || *it != 's') {
report_error("invalid format specifier");
}
FMT_FALLTHROUGH;
case 's':
if (it == end || *it != 's' || !std::is_same<T, Char>::value) {
if (!std::is_same<T, Char>::value) {
report_error("invalid format specifier");
}
if (!is_debug) {
Expand Down

0 comments on commit 5151ee4

Please sign in to comment.