diff options
author | Dario Lombardo <lomato@gmail.com> | 2019-08-01 13:35:53 +0200 |
---|---|---|
committer | Dario Lombardo <lomato@gmail.com> | 2019-08-01 19:58:06 +0000 |
commit | ad5db22a14a0dd1053f7cf9a86c2608876261812 (patch) | |
tree | ea98edad05c0c45c106c841c55a08a0b532d8e66 | |
parent | e7852aa3ba4e14280987a122fb8337ee9b93cde1 (diff) |
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 <guy@alum.mit.edu>
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
-rw-r--r-- | caputils/capture-pcap-util.c | 4 |
1 files 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) { /* |