summaryrefslogtreecommitdiff
path: root/tools/vsh-table.c
diff options
context:
space:
mode:
authorSimon Kobyda <skobyda@redhat.com>2018-11-27 10:07:32 +0100
committerMichal Privoznik <mprivozn@redhat.com>2018-11-28 13:18:48 +0100
commit071488983c4849e7e911656c8c2412e73d5daabf (patch)
tree296fc1fb740e5edd425f9ba533bd66712856f0d4 /tools/vsh-table.c
parent4b4ed783ba967c3166b1a04c42bda4e113cc0dc1 (diff)
downloadlibvirt-071488983c4849e7e911656c8c2412e73d5daabf.tar.gz
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>
Diffstat (limited to 'tools/vsh-table.c')
-rw-r--r--tools/vsh-table.c6
1 files 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');
}