Browse Source

buffer_seek did not work at all m(

master
Felix von Leitner 3 months ago
parent
commit
fe000e3df8
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      buffer/buffer_seek.c

+ 4
- 1
buffer/buffer_seek.c View File

@ -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