Closed mehlis closed 11 years ago
On Mon, 2 Sep 2013, Christian Mehlis wrote:
https://github.com/cn-uofbasel/ccn-lite/blob/master/ccnl-core.h#L112
I think this should be like MAX_DATA_LEN not 1
the data field is used for storing the content, right now it uses the memory after this struct. this struct is created via calloc, so we are in the heap.
The ccnl_buf_s structure is but a header.
The len of 1 is correct (with 0, which I would have preferred, the compiler is not happy).
The real length of a buffer is allocated in ccnl-core.c#L35 In fact, we allocate 1 byte too much.
best, christian
I see, you are right. I don't see a better way to implement this without this dummy array. Perhaps a comment in source code would be nice for the next time someone is confused.
https://github.com/cn-uofbasel/ccn-lite/blob/master/ccnl-core.h#L112
I think this should be like
MAX_DATA_LEN
not1
the data field is used for storing the content, right now it uses the memory after this struct. this struct is created via
calloc
, so we are in the heap.