Commit d7763907 authored by Joanne Hugé's avatar Joanne Hugé

WIP: Fix segfault

parent 494b9dae
...@@ -217,8 +217,8 @@ static int rbuf_contiguous_copy(ring_buffer_t * rbuf1, ring_buffer_t * rbuf2, in ...@@ -217,8 +217,8 @@ static int rbuf_contiguous_copy(ring_buffer_t * rbuf1, ring_buffer_t * rbuf2, in
#define RBUF_WRITE(rbuf, i, type) (((type *) rbuf.buffer) + (((rbuf.write_index + i) % rbuf.buf_len) * rbuf.len)) #define RBUF_WRITE(rbuf, i, type) (((type *) rbuf.buffer) + (((rbuf.write_index + i) % rbuf.buf_len) * rbuf.len))
#define RBUF_INIT(rbuf, _name, _buf_len, _len, type) do\ #define RBUF_INIT(rbuf, _name, _buf_len, _len, type) do\
{\ {\
log_debug("TRX_ECPRI", "Allocating %s with %d bytes\n", _name, (_buf_len * _len * sizeof(type)));\ log_debug("TRX_ECPRI", "Allocating %s with %d bytes\n", _name, (((int) _buf_len) * ((int) _len) * sizeof(type)));\
rbuf.buffer = (type *) malloc(_buf_len * _len * sizeof(type));\ rbuf.buffer = (type *) malloc(((int) _buf_len) * ((int) _len) * sizeof(type));\
strcpy(rbuf.name, _name);\ strcpy(rbuf.name, _name);\
rbuf.buf_len = _buf_len;\ rbuf.buf_len = _buf_len;\
rbuf.len = _len;\ rbuf.len = _len;\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment