5 /* grow a String's allocation by at least `incr' bytes */
7 s_grow(String *s, int incr)
13 sysfatal("s_grow of constant string");
17 * take a larger increment to avoid mallocing too often
19 size = s->end-s->base;
25 cp = realloc(s->base, size);
27 sysfatal("s_grow: %r");
28 s->ptr = (s->ptr - s->base) + cp;