]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/allow_zero_btr_add'
authorAndre Noll <maan@systemlinux.org>
Thu, 2 May 2013 17:55:18 +0000 (19:55 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 2 May 2013 17:55:18 +0000 (19:55 +0200)
Was cooking for over a month.

1  2 
buffer_tree.c

diff --combined buffer_tree.c
index bb854124c6be6089f604815473755af783ceb5e8,cc2bb511696f2e65240a17bbc4962b20c9f0930b..f0a7b224f9fad39fd8036d37eedbf619e3ca585b
@@@ -1,5 -1,5 +1,5 @@@
  /*
 - * Copyright (C) 2009-2012 Andre Noll <maan@systemlinux.org>
 + * Copyright (C) 2009-2013 Andre Noll <maan@systemlinux.org>
   *
   * Licensed under the GPL v2. For licencing details see COPYING.
   */
@@@ -386,7 -386,8 +386,8 @@@ void btr_add_output(char *buf, size_t s
  {
        struct btr_buffer *btrb;
  
-       assert(size != 0);
+       if (size == 0)
+               return;
        if (list_empty(&btrn->children)) {
                free(buf);
                return;
@@@ -415,7 -416,8 +416,8 @@@ void btr_add_output_dont_free(const cha
  {
        struct btr_buffer *btrb;
  
-       assert(size != 0);
+       if (size == 0)
+               return;
        if (list_empty(&btrn->children))
                return;
        btrb = new_btrb((char *)buf, size);
@@@ -442,7 -444,8 +444,8 @@@ void btr_add_output_pool(struct btr_poo
        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);