diff --git a/include/fmt/printf.h b/include/fmt/printf.h index f7eb28c8..ed84f1b2 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -504,10 +504,10 @@ OutputIt basic_printf_context::format() { format_arg arg = get_arg(arg_index); if (specs.precision >= 0 && arg.type() == internal::type::cstring_type) { auto str = visit_format_arg(internal::get_cstring(), arg); - auto end = str + specs.precision; - auto nul = std::find(str, end, Char()); + auto str_end = str + specs.precision; + auto nul = std::find(str, str_end, Char()); arg = internal::make_arg(basic_string_view( - str, nul != end ? nul - str : specs.precision)); + str, nul != str_end ? nul - str : specs.precision)); } if (specs.alt && visit_format_arg(internal::is_zero_int(), arg)) specs.alt = false;