-/*
- * Like term_chara() but for arbitrary-length buffers. Resize the
- * buffer by a factor of two (if the buffer is less than that) or the
- * buffer's size.
- */
-static void
-term_stringa(struct termp *p, const char *c, size_t sz)
-{
- size_t s;
-
- if (0 == sz)
- return;
-
- assert(c);
- if (p->col + sz >= p->maxcols) {
- if (0 == p->maxcols)
- p->maxcols = 256;
- s = sz > p->maxcols * 2 ? sz : p->maxcols * 2;
- p->buf = realloc(p->buf, s);
- if (NULL == p->buf)
- err(1, "realloc");
- p->maxcols = s;
- }
-
- (void)memcpy(&p->buf[(int)p->col], c, sz);
- p->col += sz;
-}
-
-