buffer_seek did not work at all m(

master
leitner 4 years ago
parent 91c02ad365
commit ebb3086b5c

@ -27,7 +27,10 @@ ssize_t buffer_seek(buffer* b,size_t len) {
ssize_t r = buffer_feed(b); ssize_t r = buffer_feed(b);
if (r < 0) return -1; if (r < 0) return -1;
if (r == 0) break; 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; len -= r;
b->p = b->n = 0; b->p = b->n = 0;
} }

Loading…
Cancel
Save