There is no need to abort on the attempt to add a zero sized buffer.
Let's be gentle and make this condition a noop rather than a fatal
error.
{
struct btr_buffer *btrb;
- assert(size != 0);
+ if (size == 0)
+ return;
if (list_empty(&btrn->children)) {
free(buf);
return;
{
struct btr_buffer *btrb;
- assert(size != 0);
+ if (size == 0)
+ return;
if (list_empty(&btrn->children))
return;
btrb = new_btrb((char *)buf, size);
char *buf;
size_t avail;
- assert(size != 0);
+ if (size == 0)
+ return;
if (list_empty(&btrn->children))
return;
avail = btr_pool_get_buffer(btrp, &buf);