forked from osmocom/wireshark
parent
76582cf2e2
commit
e6ccfc6944
|
@ -97,8 +97,9 @@ void buffer_append(Buffer* buffer, guchar *from, gsize bytes)
|
|||
void buffer_remove_start(Buffer* buffer, gsize bytes)
|
||||
{
|
||||
if (buffer->start + bytes > buffer->first_free) {
|
||||
g_error("buffer_remove_start trying to remove %d bytes. s=%d ff=%d!\n",
|
||||
bytes, buffer->start, buffer->first_free);
|
||||
g_error("buffer_remove_start trying to remove %" G_GINT64_MODIFIER "u bytes. s=%" G_GINT64_MODIFIER "u ff=%" G_GINT64_MODIFIER "u!\n",
|
||||
(guint64)bytes, (guint64)buffer->start,
|
||||
(guint64)buffer->first_free);
|
||||
exit(1);
|
||||
}
|
||||
buffer->start += bytes;
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
#define SOME_FUNCTIONS_ARE_DEFINES
|
||||
|
||||
typedef struct Buffer {
|
||||
guchar *data;
|
||||
gsize allocated;
|
||||
unsigned int start;
|
||||
unsigned int first_free;
|
||||
guchar *data;
|
||||
gsize allocated;
|
||||
gsize start;
|
||||
gsize first_free;
|
||||
} Buffer;
|
||||
|
||||
void buffer_init(Buffer* buffer, gsize space);
|
||||
|
|
Loading…
Reference in New Issue