mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
virsh: use virBufferTrim in cmdDomFSInfo
Add comma after every string and trim the final one. Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
066d91ec79
commit
0e7707d830
@ -13968,11 +13968,9 @@ cmdDomFSInfo(vshControl *ctl, const vshCmd *cmd)
|
||||
virBuffer targetsBuff = VIR_BUFFER_INITIALIZER;
|
||||
VIR_AUTOFREE(char *) targets = NULL;
|
||||
|
||||
for (j = 0; j < info[i]->ndevAlias; j++) {
|
||||
virBufferAdd(&targetsBuff, info[i]->devAlias[j], -1);
|
||||
if (j != info[i]->ndevAlias - 1)
|
||||
virBufferAddChar(&targetsBuff, ',');
|
||||
}
|
||||
for (j = 0; j < info[i]->ndevAlias; j++)
|
||||
virBufferAsprintf(&targetsBuff, "%s,", info[i]->devAlias[j]);
|
||||
virBufferTrim(&targetsBuff, ",", -1);
|
||||
|
||||
targets = virBufferContentAndReset(&targetsBuff);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user