From: Michal Privoznik <mprivozn(a)redhat.com>
In a few places, when a size_t typed argument is passed to a
printf-like function the corresponding specifier is %ld instead
of %zu. Fix those places.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/ch/ch_monitor.c | 4 ++--
src/ch/ch_process.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 1c2c1f2858..78b6551d6c 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -156,7 +156,7 @@ virCHMonitorBuildPayloadJson(virJSONValue *content, virDomainDef
*vmdef)
buf = g_base64_decode(vmdef->sec->data.sev_snp.host_data, &len);
if (len != host_data_len) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Invalid host_data provided. Expected
'%1$ld' bytes"),
+ _("Invalid host_data provided. Expected
'%1$zu' bytes"),
host_data_len);
return -1;
}
@@ -1139,7 +1139,7 @@ virCHMonitorBuildRestoreJson(virDomainDef *vmdef,
g_autoptr(virJSONValue) nets = virJSONValueNewArray();
for (i = 0; i < vmdef->nnets; i++) {
g_autoptr(virJSONValue) net_json = virJSONValueNewObject();
- g_autofree char *id = g_strdup_printf("%s_%ld", CH_NET_ID_PREFIX,
i);
+ g_autofree char *id = g_strdup_printf("%s_%zu", CH_NET_ID_PREFIX,
i);
if (virJSONValueObjectAppendString(net_json, "id", id) < 0)
return -1;
if (virJSONValueObjectAppendNumberInt(net_json, "num_fds",
vmdef->nets[i]->driver.virtio.queues))
diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
index a008b52752..95c808cb41 100644
--- a/src/ch/ch_process.c
+++ b/src/ch/ch_process.c
@@ -701,7 +701,7 @@ chProcessAddNetworkDevices(virCHDriver *driver,
VIR_DEBUG("payload sent with net-add request to CH = %s", payload);
virBufferAsprintf(&buf, "%s",
virBufferCurrentContent(&http_headers));
- virBufferAsprintf(&buf, "Content-Length: %ld\r\n\r\n",
strlen(payload));
+ virBufferAsprintf(&buf, "Content-Length: %zu\r\n\r\n",
strlen(payload));
virBufferAsprintf(&buf, "%s", payload);
payload_len = virBufferUse(&buf);
payload = virBufferContentAndReset(&buf);
@@ -1130,7 +1130,7 @@ virCHProcessStartRestore(virCHDriver *driver, virDomainObj *vm,
const char *from
virBufferAddLit(&http_headers, "Host: localhost\r\n");
virBufferAddLit(&http_headers, "Content-Type: application/json\r\n");
virBufferAsprintf(&buf, "%s",
virBufferCurrentContent(&http_headers));
- virBufferAsprintf(&buf, "Content-Length: %ld\r\n\r\n",
strlen(payload));
+ virBufferAsprintf(&buf, "Content-Length: %zu\r\n\r\n",
strlen(payload));
virBufferAsprintf(&buf, "%s", payload);
payload_len = virBufferUse(&buf);
payload = virBufferContentAndReset(&buf);
--
2.49.0