From: guy Date: Mon, 16 Apr 2001 21:59:38 +0000 (+0000) Subject: The "data" member of a Buffer structure is a "u_char *"; when assigning X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=7fa8402de642186c0c32ff14bec65b35c6f3a617 The "data" member of a Buffer structure is a "u_char *"; when assigning the result of a "g_malloc()" to it, cast it to "u_char *", not "char *". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3309 f5534014-38df-0310-8fa8-9805f1628bb7 --- diff --git a/wiretap/buffer.c b/wiretap/buffer.c index 2ce99c6053..19b23d44c9 100644 --- a/wiretap/buffer.c +++ b/wiretap/buffer.c @@ -1,6 +1,6 @@ /* buffer.c * - * $Id: buffer.c,v 1.10 2000/08/11 13:32:37 deniel Exp $ + * $Id: buffer.c,v 1.11 2001/04/16 21:59:38 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -38,7 +38,7 @@ /* Initializes a buffer with a certain amount of allocated space */ void buffer_init(Buffer* buffer, unsigned int space) { - buffer->data = (char*)g_malloc(space); + buffer->data = (u_char*)g_malloc(space); buffer->allocated = space; buffer->start = 0; buffer->first_free = 0; @@ -88,7 +88,7 @@ void buffer_assure_space(Buffer* buffer, unsigned int space) /* We'll allocate more space */ buffer->allocated += space + 1024; - buffer->data = (char*)g_realloc(buffer->data, buffer->allocated); + buffer->data = (u_char*)g_realloc(buffer->data, buffer->allocated); } void buffer_append(Buffer* buffer, u_char *from, unsigned int bytes)