]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fb-pool.c
Resources: Allow res_free(NULL) and res_detach(NULL)
[libucw.git] / ucw / fb-pool.c
index e889c8e9459f79400262137590b66e68e66339d0..17a9c6dc5ed7de6a96150ebd3a2cce830bff2e87 100644 (file)
 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;
     }
 }