]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fb-pool.c
Heap: Adjust callers
[libucw.git] / ucw / fb-pool.c
index e889c8e9459f79400262137590b66e68e66339d0..e8628dcd9e09bd9c9efd6e4ca09b9fe1b230fc85 100644 (file)
@@ -7,24 +7,23 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/mempool.h"
-#include "ucw/fastbuf.h"
+#include <ucw/lib.h>
+#include <ucw/mempool.h>
+#include <ucw/fastbuf.h>
 
 #include <stdio.h>
 #include <stdlib.h>
 
-#define FB_POOL(f) ((struct fbpool *)(f)->is_fastbuf)
+#define FB_POOL(f) ((struct fbpool *)(f))
 
 static void
 fbpool_spout(struct fastbuf *b)
 {
-  if (b->bptr >= b->bufend)
+  if (b->bptr == b->bufend)
     {
       uns len = b->bufend - b->buffer;
-      b->buffer = mp_expand(FB_POOL(b)->mp);
+      b->bstop = b->buffer = mp_expand(FB_POOL(b)->mp);
       b->bufend = b->buffer + mp_avail(FB_POOL(b)->mp);
-      b->bstop = b->buffer;
       b->bptr = b->buffer + len;
     }
 }