libowfat/buffer/buffer_get.c
leitner 6196f771cd remove a few gcc 4 warnings
work around freebsd 5.4 brokenness (if you don't have IPv6 in the
    kernel, socket(PF_INET6,SOCK_STREAM,0) returns EPROTONOSUPPORT
    instead of EPFNOSUPPORT, which basically says "yeah, I know IPv6,
    but TCP?  never heard of it")
2005-05-05 15:55:41 +00:00

13 lines
266 B
C

#include "byte.h"
#include "buffer.h"
int buffer_get(buffer* b,char* x,unsigned long int len) {
int blen;
if ((blen=buffer_feed(b))<0) return blen;
if ((unsigned long int) blen>=len)
blen=len;
byte_copy(x,blen,b->x+b->p);
b->p+=blen;
return blen;
}