]> mj.ucw.cz Git - libucw.git/commitdiff
Fastbufs: Fixed broken seeking in fbbuf.
authorPavel Charvat <pchar@ucw.cz>
Thu, 29 Mar 2012 19:45:24 +0000 (21:45 +0200)
committerPavel Charvat <pchar@ucw.cz>
Thu, 29 Mar 2012 19:45:24 +0000 (21:45 +0200)
ucw/fb-buffer.c

index 8e87d39dca9868352365d8fb3fca895c7f61b00c..9fc92277b2248ee99a33fa3e34ae9d1652b9bec0 100644 (file)
@@ -31,8 +31,8 @@ fbbuf_seek(struct fastbuf *f, ucw_off_t pos, int whence)
   if (pos < 0 || pos > len)
     bthrow(f, "seek", "Seek out of range");
   f->bptr = f->buffer + pos;
-  f->bstop = f->buffer;
-  f->pos = 0;
+  f->bstop = f->bufend;
+  f->pos = len;
   return 1;
 }