diff --git a/buffer/buffer_0.c b/buffer/buffer_0.c index 2af2c15..d55dd93 100644 --- a/buffer/buffer_0.c +++ b/buffer/buffer_0.c @@ -7,6 +7,6 @@ static int b0read(int fd,const char* buf, unsigned int len) { } char buffer_0_space[BUFFER_INSIZE]; -static buffer it = BUFFER_INIT(b0read,0,buffer_0_space,0); +static buffer it = BUFFER_INIT(b0read,0,buffer_0_space,sizeof buffer_0_space); buffer *buffer_0 = ⁢ diff --git a/buffer/buffer_0small.c b/buffer/buffer_0small.c index 794a567..40fed23 100644 --- a/buffer/buffer_0small.c +++ b/buffer/buffer_0small.c @@ -7,6 +7,6 @@ static int b0read(int fd,const char* buf, unsigned int len) { } char buffer_0_space[128]; -static buffer it = BUFFER_INIT(b0read,0,buffer_0_space,0); +static buffer it = BUFFER_INIT_READ(b0read,0,buffer_0_space,sizeof buffer_0_space); buffer *buffer_0small = ⁢ diff --git a/buffer/buffer_feed.c b/buffer/buffer_feed.c index 0dbcea0..8e35aba 100644 --- a/buffer/buffer_feed.c +++ b/buffer/buffer_feed.c @@ -5,7 +5,7 @@ extern int buffer_stubborn_read(int (*op)(),int fd,const char* buf, unsigned int int buffer_feed(buffer* b) { if (b->p==b->n) { int w; - if ((w=buffer_stubborn_read(b->op,b->fd,b->x,b->n))<0) + if ((w=buffer_stubborn_read(b->op,b->fd,b->x,b->a))<0) return -1; b->n=w; b->p=0; diff --git a/buffer/buffer_stubborn2.c b/buffer/buffer_stubborn2.c index 9e553fb..37103ed 100644 --- a/buffer/buffer_stubborn2.c +++ b/buffer/buffer_stubborn2.c @@ -6,6 +6,7 @@ int buffer_stubborn_read(int (*op)(),int fd,const char* buf, unsigned int len) { for (;;) { if ((w=op(fd,buf,len))<0) if (errno == EINTR) continue; + break; } return w; }