From: Michal Privoznik Date: Mon, 1 Aug 2016 08:21:04 +0000 (+0200) Subject: wireshark: Drop glib dependency X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1045c56c0fcd52d01c229e7ae9581e16387f9d30;p=libvirt.git wireshark: Drop glib dependency The only function that we currently use from glib is g_sprintf(). That's a very big gun for such small target. Not only that, but we've silently relied on wireshark dragging in the glib. Replace the g_sprintf() with plain sprinf() so that we can drop the glib dependency. Signed-off-by: Michal Privoznik --- diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c index 569a0a1729..260161e98d 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -27,8 +27,6 @@ #include #include #include -#include -#include #ifdef HAVE_RPC_TYPES_H # include #endif @@ -113,7 +111,7 @@ format_xdr_bytes(guint8 *bytes, guint32 length) for (i = 0; i < length; i++) { /* We know that buf has enough size to contain 2 * length + '\0' characters. */ - g_sprintf(buf, "%02x", bytes[i]); + snprintf(buf, 2*(length - i) + 1, "%02x", bytes[i]); buf += 2; } return buf - length*2;