[libvirt] [PATCH] 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 <mprivozn@redhat.com> --- tools/wireshark/src/packet-libvirt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c index 569a0a1..9eadf4f 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -27,8 +27,6 @@ #include <wireshark/epan/proto.h> #include <wireshark/epan/packet.h> #include <wireshark/epan/dissectors/packet-tcp.h> -#include <glib.h> -#include <glib/gprintf.h> #ifdef HAVE_RPC_TYPES_H # include <rpc/types.h> #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]); + sprintf(buf, "%02x", bytes[i]); buf += 2; } return buf - length*2; -- 2.8.4

On Mon, Aug 01, 2016 at 10:25:09AM +0200, Michal Privoznik wrote:
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 <mprivozn@redhat.com> --- tools/wireshark/src/packet-libvirt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
ACK Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Michal Privoznik