Browse Source

buffer_seek did not work at all m(

master
Felix von Leitner 11 months ago
parent
commit
fe000e3df8
  1. 5
      buffer/buffer_seek.c

5
buffer/buffer_seek.c

@ -27,7 +27,10 @@ ssize_t buffer_seek(buffer* b,size_t len) {
ssize_t r = buffer_feed(b);
if (r < 0) return -1;
if (r == 0) break;
if ((size_t)r > len) r = len; // can't happen
if ((size_t)r > len) { // awesome, we are done
b->p = len;
return r;
}
len -= r;
b->p = b->n = 0;
}

Loading…
Cancel
Save