/* -*-c-*-
*
- * $Id: dstr.c,v 1.13 1999/12/22 15:39:28 mdw Exp $
+ * $Id: dstr.c,v 1.15 2000/07/16 12:29:16 mdw Exp $
*
* Handle dynamically growing strings
*
/*----- Revision history --------------------------------------------------*
*
* $Log: dstr.c,v $
+ * Revision 1.15 2000/07/16 12:29:16 mdw
+ * Change to arena `realloc' interface, to fix a design bug.
+ *
+ * Revision 1.14 2000/06/17 10:37:39 mdw
+ * Add support for arena management.
+ *
* Revision 1.13 1999/12/22 15:39:28 mdw
* Fix overflow in dstr_putline.
*
do nsz <<= 1; while (nsz < rq);
if (d->buf)
- d->buf = xrealloc(d->buf, nsz);
+ d->buf = x_realloc(d->a, d->buf, nsz, d->sz);
else
- d->buf = xmalloc(nsz);
+ d->buf = x_alloc(d->a, nsz);
d->sz = nsz;
}
void dstr_tidy(dstr *d)
{
- d->buf = xrealloc(d->buf, d->len + 1);
+ d->buf = x_realloc(d->a, d->buf, d->len + 1, d->sz);
d->buf[d->len] = 0;
d->sz = d->len + 1;
}