From cf7ee43cf175fa84a4a61b309f778bdd60a28e5a Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 13 Feb 2023 14:46:09 +0100 Subject: libvirt-override: Don't typecast strlen() in debug printings After some data was read from an incoming stream, we debug print their length using strlen() (assuming its text stream, not binary stream). Anyway, the debug format uses %d which then requires strlen() to be typecasted. Well, we can use %zu and drop the typecast. Signed-off-by: Michal Privoznik --- libvirt-override.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt-override.c b/libvirt-override.c index 0aaeb31..f103c02 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -7926,7 +7926,7 @@ libvirt_virStreamRecv(PyObject *self ATTRIBUTE_UNUSED, LIBVIRT_END_ALLOW_THREADS; buf[ret > -1 ? ret : 0] = '\0'; - DEBUG("StreamRecv ret=%d strlen=%d\n", ret, (int) strlen(buf)); + DEBUG("StreamRecv ret=%d strlen=%zu\n", ret, strlen(buf)); if (ret == -2) { VIR_FREE(buf); @@ -10071,7 +10071,7 @@ libvirt_virStreamRecvFlags(PyObject *self ATTRIBUTE_UNUSED, LIBVIRT_END_ALLOW_THREADS; buf[ret > -1 ? ret : 0] = '\0'; - DEBUG("StreamRecvFlags ret=%d strlen=%d\n", ret, (int) strlen(buf)); + DEBUG("StreamRecvFlags ret=%d strlen=%zu\n", ret, strlen(buf)); if (ret == -2 || ret == -3) return libvirt_intWrap(ret); -- cgit v1.2.1