+/* --- @lbuf_setsize@ --- *
+ *
+ * Arguments: @lbuf *b@ = pointer to buffer block
+ * @size_t sz@ = requested maximum line size
+ *
+ * Returns: ---
+ *
+ * Use: Modifies the size of the buffer associated with the block.
+ * It is an error to resize a buffer while it contains data.
+ */
+
+void lbuf_setsize(lbuf *b, size_t sz)
+{
+ if (b->buf)
+ assert(((void)"Buffer in use in lbuf_setsize",
+ b->len == 0 || b->len == b->sz));
+ if (b->buf)
+ x_free(b->a, b->buf);
+ b->sz = sz;
+ b->buf = 0;
+}
+