diff --git a/test/std-format-test.cc b/test/std-format-test.cc index 8bf4b6d1..b305ad85 100644 --- a/test/std-format-test.cc +++ b/test/std-format-test.cc @@ -111,7 +111,7 @@ template <> struct std::formatter { char c = get_char(); if (!isdigit(c) || (++iter, get_char()) != '}') throw format_error("invalid format"); - width_arg_id = c - '0'; + width_arg_id = fmt::detail::to_unsigned(c - '0'); ctx.check_arg_id(width_arg_id); return ++iter; }