libowfat/buffer/buffer_putalign.c
leitner eeffc36387 remove even more warnings
64-bit cleanliness issue with auto-NULL-appending macros
2005-05-12 06:52:29 +00:00

17 lines
344 B
C

#include "byte.h"
#include "buffer.h"
int buffer_putalign(buffer* b,const char* buf,unsigned long int len) {
unsigned int tmp;
while (len>(tmp=b->a-b->p)) {
byte_copy(b->x+b->p, tmp, buf);
b->p+=tmp;
buf+=tmp;
len-=tmp;
if (buffer_flush(b)<0) return -1;
}
byte_copy(b->x+b->p, len, buf);
b->p+=len;
return 0;
}