[Spice-devel] [PATCH spice-server] red-qxl: Use proper formatting string for size_t

Frediano Ziglio fziglio at redhat.com
Thu Jan 31 09:32:33 UTC 2019


Avoids issues with LLP64 systems.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-qxl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index 37f3d9c8..ddb98afb 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -862,7 +862,8 @@ void spice_qxl_set_device_info(QXLInstance *instance,
 
     size_t da_len = strnlen(device_address, MAX_DEVICE_ADDRESS_LEN);
     if (da_len >= MAX_DEVICE_ADDRESS_LEN) {
-        spice_error("Device address too long: %lu > %u", da_len, MAX_DEVICE_ADDRESS_LEN);
+        spice_error("Device address too long: %"G_GSIZE_FORMAT" > %u",
+                    da_len, MAX_DEVICE_ADDRESS_LEN);
         return;
     }
 
-- 
2.20.1



More information about the Spice-devel mailing list