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:
@@ -1426,14 +1426,11 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
|
||||
volInfoTexts[i].type = g_strdup(virshVolumeTypeToString(volumeInfo.type));
|
||||
|
||||
val = vshPrettyCapacity(volumeInfo.capacity, &unit);
|
||||
if (virAsprintf(&volInfoTexts[i].capacity,
|
||||
"%.2lf %s", val, unit) < 0)
|
||||
goto cleanup;
|
||||
volInfoTexts[i].capacity = g_strdup_printf("%.2lf %s", val, unit);
|
||||
|
||||
val = vshPrettyCapacity(volumeInfo.allocation, &unit);
|
||||
if (virAsprintf(&volInfoTexts[i].allocation,
|
||||
"%.2lf %s", val, unit) < 0)
|
||||
goto cleanup;
|
||||
volInfoTexts[i].allocation = g_strdup_printf("%.2lf %s", val,
|
||||
unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user