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

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

 



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

Signed-off-by: Simon Kobyda <skobyda@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux