// If the padding is on the left side, write the spaces first.
if (padding_spaces > 0 &&
(to_conv.flags & FormatFlags::LEFT_JUSTIFIED) == 0) {
- RET_IF_RESULT_NEGATIVE(writer->write(' ', to_conv.min_width - string_len));
+ RET_IF_RESULT_NEGATIVE(writer->write(' ', padding_spaces));
}
RET_IF_RESULT_NEGATIVE(writer->write(c));
// If the padding is on the right side, write the spaces last.
if (padding_spaces > 0 &&
(to_conv.flags & FormatFlags::LEFT_JUSTIFIED) != 0) {
- RET_IF_RESULT_NEGATIVE(writer->write(' ', to_conv.min_width - string_len));
+ RET_IF_RESULT_NEGATIVE(writer->write(' ', padding_spaces));
}
return WRITE_OK;
// If the padding is on the left side, write the spaces first.
if (padding_spaces > 0 &&
(to_conv.flags & FormatFlags::LEFT_JUSTIFIED) == 0) {
- RET_IF_RESULT_NEGATIVE(writer->write(' ', to_conv.min_width - string_len));
+ RET_IF_RESULT_NEGATIVE(writer->write(' ', padding_spaces));
}
RET_IF_RESULT_NEGATIVE(writer->write(
// If the padding is on the right side, write the spaces last.
if (padding_spaces > 0 &&
(to_conv.flags & FormatFlags::LEFT_JUSTIFIED) != 0) {
- RET_IF_RESULT_NEGATIVE(writer->write(' ', to_conv.min_width - string_len));
+ RET_IF_RESULT_NEGATIVE(writer->write(' ', padding_spaces));
}
return WRITE_OK;
}