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:
Michal Privoznik
2019-10-22 15:26:14 +02:00
parent 4fa804c0c7
commit 26a137093b
12 changed files with 61 additions and 103 deletions

View File

@@ -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)
&timestr) < 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)