diff --git a/buffer.h b/buffer.h index 7a801d2..2d64184 100644 --- a/buffer.h +++ b/buffer.h @@ -5,11 +5,13 @@ typedef struct buffer { char *x; unsigned int p; unsigned int n; + unsigned int a; int fd; int (*op)(); } buffer; -#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) } +#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), 0, (fd), (op) } +#define BUFFER_INIT_READ(op,fd,buf,len) { (buf), 0, 0, (len), (fd), (op) } #define BUFFER_INSIZE 8192 #define BUFFER_OUTSIZE 8192 diff --git a/socket/fmt_ip6.c b/socket/fmt_ip6.c index 9c224d6..ee7e25e 100644 --- a/socket/fmt_ip6.c +++ b/socket/fmt_ip6.c @@ -16,7 +16,6 @@ unsigned int fmt_ip6(char *s,const char ip[16]) if (j==12 && ip6_isv4mapped(ip)) { temp=ip4_fmt(s,ip+12); len+=temp; - if (s) s+=temp; break; } temp = ((unsigned long) (unsigned char) ip[j] << 8) + diff --git a/t.c b/t.c index ce93d90..7aaa620 100644 --- a/t.c +++ b/t.c @@ -20,7 +20,8 @@ int main(int argc,char* argv[]) { buffer_flush(buffer_1small); #endif - buf[fmt_xlong(buf,0)]=0; + buf[0]=0; + buf[fmt_8long(buf,0)]=0; puts(buf); rdtscl(a); c=str_len(buf);