[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 1/2] vsh-table: Get rid of trailing spaces



Get rid of trailing spaces which can be found after last column in tables.

Signed-off-by: Simon Kobyda <skobyda redhat com>
---
 tools/vsh-table.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/vsh-table.c b/tools/vsh-table.c
index 9b4a34c1e6..fb656ffeb0 100644
--- a/tools/vsh-table.c
+++ b/tools/vsh-table.c
@@ -348,8 +348,10 @@ vshTableRowPrint(vshTableRowPtr row,
     for (i = 0; i < row->ncells; i++) {
         virBufferAsprintf(buf, " %s", row->cells[i]);
 
-        for (j = 0; j < maxwidths[i] - widths[i] + 2; j++)
-            virBufferAddChar(buf, ' ');
+        if (i < (row->ncells - 1)) {
+            for (j = 0; j < maxwidths[i] - widths[i] + 2; j++)
+                virBufferAddChar(buf, ' ');
+        }
     }
     virBufferAddChar(buf, '\n');
 }
-- 
2.17.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]