libowfat/buffer/buffer_getc.c
leitner 5eb1cdf888 cleanups in stralloc and buffer:
int -> long for sizes
    char -> unsigned char for strings
2004-11-25 21:29:35 +00:00

13 lines
220 B
C

#include "byte.h"
#include "buffer.h"
int buffer_getc(buffer* b,unsigned char* x) {
if (b->p==b->n) {
register int blen;
if ((blen=buffer_feed(b))<=0) return blen;
}
*x=b->x[b->p];
++b->p;
return 1;
}