Skip to content

Commit

Permalink
Avoid trailing spaces in each line (#6910).
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Jul 30, 2021
1 parent 234ae81 commit bb8edfa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dsql/dsql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2261,8 +2261,13 @@ static void sql_info(thread_db* tdbb,
{
auto& localPath = *static_cast<decltype(path)*>(arg);
auto lineLen = strlen(line);

// Trim trailing spaces.
while (lineLen > 0 && line[lineLen - 1] == ' ')
--lineLen;

char offsetStr[10];
auto offsetLen = sprintf(offsetStr, "%5d", (int) offset);
const auto offsetLen = sprintf(offsetStr, "%5d", (int) offset);

localPath.push(reinterpret_cast<const UCHAR*>(offsetStr), offsetLen);
localPath.push(' ');
Expand Down

0 comments on commit bb8edfa

Please sign in to comment.