diff --git a/source/utilities.tex b/source/utilities.tex index f856a423b4..d3f5015061 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17713,12 +17713,13 @@ // Parses a width argument id in the format \tcode{\{} \fmtgrammarterm{digit} \tcode{\}}. constexpr auto parse(format_parse_context& ctx) { auto iter = ctx.begin(); + auto is_digit = [](auto c) { return c >= '0' && c <= '9'; }; auto get_char = [&]() { return iter != ctx.end() ? *iter : 0; }; if (get_char() != '{') return iter; ++iter; char c = get_char(); - if (!isdigit(c) || (++iter, get_char()) != '}') + if (!is_digit(c) || (++iter, get_char()) != '}') throw format_error("invalid format"); width_arg_id = c - '0'; ctx.check_arg_id(width_arg_id); @@ -17735,7 +17736,7 @@ else return value; }); - return format_to(ctx.out(), "{0:x<{1}}", s.value, width); + return format_to(ctx.out(), "{0:x>{1}}", s.value, width); } };