version 1.9, 2003/06/25 21:19:19 |
version 1.10, 2003/09/26 22:22:50 |
|
|
} |
} |
|
|
if (indx + 1 > buf_max) { |
if (indx + 1 > buf_max) { |
|
int newmax = buf_max + 2048; |
|
char *newbuf; |
|
|
/* Allocate buffer in LINE_MAX increments */ |
/* Allocate buffer in LINE_MAX increments */ |
buf_max += 2048; |
if ((newbuf = realloc(buf, newmax)) == NULL) { |
if((buf = realloc(buf, buf_max)) == NULL) { |
|
err(1, NULL); |
err(1, NULL); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
|
buf = newbuf; |
|
buf_max = newmax; |
} |
} |
buf[indx++] = ch; |
buf[indx++] = ch; |
} |
} |