mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tools: Use g_strdup_printf() instead of virAsprintf()
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
@@ -394,8 +394,7 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
|
||||
|
||||
for (i = 0; i < nsrvs; i++) {
|
||||
g_autofree char *idStr = NULL;
|
||||
if (virAsprintf(&idStr, "%zu", i) < 0)
|
||||
goto cleanup;
|
||||
idStr = g_strdup_printf("%zu", i);
|
||||
|
||||
if (vshTableRowAppend(table,
|
||||
idStr,
|
||||
@@ -656,8 +655,7 @@ cmdSrvClientsList(vshControl *ctl, const vshCmd *cmd)
|
||||
×tr) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virAsprintf(&idStr, "%llu", id) < 0)
|
||||
goto cleanup;
|
||||
idStr = g_strdup_printf("%llu", id);
|
||||
if (vshTableRowAppend(table, idStr,
|
||||
vshAdmClientTransportToString(transport),
|
||||
timestr, NULL) < 0)
|
||||
|
||||
Reference in New Issue
Block a user