From ad5db22a14a0dd1053f7cf9a86c2608876261812 Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Thu, 1 Aug 2019 13:35:53 +0200 Subject: caputils: cast g_malloc pointer. Fix compilation on FreeBBSD: ../caputils/capture-pcap-util.c: In function 'if_info_get': ../caputils/capture-pcap-util.c:383:17: error: request for implicit conversion from 'gpointer' {aka 'void *'} to 'char *' not permitted in C++ [-Werror=c++-compat] description = g_malloc(descr_size); ^ Change-Id: I4a3452a8b21c2bee853a50a977c418dd92a5d4b4 Reviewed-on: https://code.wireshark.org/review/34152 Reviewed-by: Guy Harris Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot --- caputils/capture-pcap-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caputils/capture-pcap-util.c b/caputils/capture-pcap-util.c index 2d5fda62e1..80304011d1 100644 --- a/caputils/capture-pcap-util.c +++ b/caputils/capture-pcap-util.c @@ -300,7 +300,7 @@ if_info_get(const char *name) */ for (;;) { g_free(description); - if ((description = g_malloc(descrlen)) != NULL) { + if ((description = (char*)g_malloc(descrlen)) != NULL) { ifrdesc.ifr_buffer.buffer = description; ifrdesc.ifr_buffer.length = descrlen; if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0) { @@ -327,7 +327,7 @@ if_info_get(const char *name) * to get the description length - it's clamped * to a maximum of IFDESCRSIZE. */ - if ((description = g_malloc(descrlen)) != NULL) { + if ((description = (char*)g_malloc(descrlen)) != NULL) { ifrdesc.ifr_data = (caddr_t)description; if (ioctl(s, SIOCGIFDESCR, &ifrdesc) != 0) { /* -- cgit v1.2.3