int i, fd = open("test/run.c", O_RDONLY);
/* This is how many tests you plan to run */
int i, fd = open("test/run.c", O_RDONLY);
/* This is how many tests you plan to run */
/* Grab ourselves for comparison. */
buf[full_read(fd, buf, sizeof(buf))] = '\0';
/* Grab ourselves for comparison. */
buf[full_read(fd, buf, sizeof(buf))] = '\0';
- rbuf_init(&in, fd, malloc(31), 31);
+ rbuf_init(&in, fd, malloc(31), 31, membuf_realloc);
- ok1(in.buf_end - in.buf == 31);
- p = rbuf_read_str(&in, '\n', NULL);
+ ok1(membuf_num_space(&in.m) == 31);
+ p = rbuf_read_str(&in, '\n');
ok1(p);
ok1(strcmp(p, lines[1]) == 0);
for (i = 2; lines[i]; i++) {
ok1(p);
ok1(strcmp(p, lines[1]) == 0);
for (i = 2; lines[i]; i++) {