diff --git a/include/fmt/format.h b/include/fmt/format.h index 6ed1a686..edad681f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1664,8 +1664,7 @@ template class basic_writer { unsigned width = to_unsigned(specs.width); size_t size = f.size(); // The number of code units. size_t num_code_points = width != 0 ? f.width() : size; - if (width <= num_code_points) return f(reserve(size)); - size_t padding = width - num_code_points; + size_t padding = width > num_code_points ? width - num_code_points : 0; size_t left_padding = 0; if (specs.align == align::right) left_padding = padding;