Skip to content

Commit 5151ee4

Browse files
committed
move error checking
1 parent 645fde4 commit 5151ee4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/fmt/ranges.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,12 @@ struct range_formatter<
426426
is_debug = true;
427427
set_brackets({}, {});
428428
++it;
429+
if (it == end || *it != 's') {
430+
report_error("invalid format specifier");
431+
}
429432
FMT_FALLTHROUGH;
430433
case 's':
431-
if (it == end || *it != 's' || !std::is_same<T, Char>::value) {
434+
if (!std::is_same<T, Char>::value) {
432435
report_error("invalid format specifier");
433436
}
434437
if (!is_debug) {

0 commit comments

Comments
 (0)