forked from fmtlib/fmt
Fix a warning.
This commit is contained in:
@@ -598,14 +598,15 @@ void fmt::BasicFormatter<Char>::DoFormat() {
|
|||||||
typedef typename BasicWriter<Char>::CharPtr CharPtr;
|
typedef typename BasicWriter<Char>::CharPtr CharPtr;
|
||||||
CharPtr out = CharPtr();
|
CharPtr out = CharPtr();
|
||||||
if (spec.width_ > 1) {
|
if (spec.width_ > 1) {
|
||||||
|
Char fill = static_cast<Char>(spec.fill());
|
||||||
out = writer.GrowBuffer(spec.width_);
|
out = writer.GrowBuffer(spec.width_);
|
||||||
if (spec.align_ == ALIGN_RIGHT) {
|
if (spec.align_ == ALIGN_RIGHT) {
|
||||||
std::fill_n(out, spec.width_ - 1, spec.fill_);
|
std::fill_n(out, spec.width_ - 1, fill);
|
||||||
out += spec.width_ - 1;
|
out += spec.width_ - 1;
|
||||||
} else if (spec.align_ == ALIGN_CENTER) {
|
} else if (spec.align_ == ALIGN_CENTER) {
|
||||||
out = writer.FillPadding(out, spec.width_, 1, spec.fill_);
|
out = writer.FillPadding(out, spec.width_, 1, fill);
|
||||||
} else {
|
} else {
|
||||||
std::fill_n(out + 1, spec.width_ - 1, spec.fill_);
|
std::fill_n(out + 1, spec.width_ - 1, fill);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
out = writer.GrowBuffer(1);
|
out = writer.GrowBuffer(1);
|
||||||
|
Reference in New Issue
Block a user