Skip to content

Commit

Permalink
fix colsWidth=0 case
Browse files Browse the repository at this point in the history
  • Loading branch information
aziz-mu committed Dec 7, 2022
1 parent e7ed3a9 commit 8ef8b53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/processor/result/flat_tuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ string FlatTuple::toString(const vector<uint32_t>& colsWidth, const string& deli
fieldLen += Utf8Proc::renderWidth(value.c_str(), chrIter);
chrIter = utf8proc_next_grapheme(value.c_str(), value.length(), chrIter);
}
result << value << string(colsWidth[i] - fieldLen, ' ');
if (colsWidth[i] != 0) {
result << value << string(colsWidth[i] - fieldLen, ' ');
} else {
result << value;
}
if (i != resultValues.size() - 1) {
result << delimiter;
}
Expand Down

0 comments on commit 8ef8b53

Please sign in to comment.