|
|
@ -7,7 +7,8 @@ ssize_t buffer_get(buffer* b,char* x,size_t len) {
|
|
|
|
done=0;
|
|
|
|
done=0;
|
|
|
|
if ((ssize_t)len < 0) len=(ssize_t)(((size_t)-1)>>1);
|
|
|
|
if ((ssize_t)len < 0) len=(ssize_t)(((size_t)-1)>>1);
|
|
|
|
while (len) {
|
|
|
|
while (len) {
|
|
|
|
if ((blen=buffer_feed(b))<=0) return blen;
|
|
|
|
if ((blen=buffer_feed(b))<0) return blen;
|
|
|
|
|
|
|
|
if (blen==0) break;
|
|
|
|
if (blen>=(ssize_t)len)
|
|
|
|
if (blen>=(ssize_t)len)
|
|
|
|
blen=(ssize_t)len;
|
|
|
|
blen=(ssize_t)len;
|
|
|
|
byte_copy(x,(size_t)blen,b->x+b->p);
|
|
|
|
byte_copy(x,(size_t)blen,b->x+b->p);
|
|
|
|