summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2023-02-13 14:46:09 +0100
committerMichal Privoznik <mprivozn@redhat.com>2023-02-13 15:01:41 +0100
commitcf7ee43cf175fa84a4a61b309f778bdd60a28e5a (patch)
treec6d712e573f7e7cdf9659e347857baf9f212368e
parent3f8aa91db35d1650d8826cf7cc74958954ca0a3f (diff)
downloadlibvirt-python-cf7ee43cf175fa84a4a61b309f778bdd60a28e5a.tar.gz
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 <mprivozn@redhat.com>
-rw-r--r--libvirt-override.c4
1 files 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);