+ * Resize a line to make it `cols' columns wide.
+ */
+unsigned long *resizeline(unsigned long *line, int cols)
+{
+ int i, oldlen;
+ unsigned long lineattrs;
+
+ if (line[0] != (unsigned long)cols) {
+ /*
+ * This line is the wrong length, which probably means it
+ * hasn't been accessed since a resize. Resize it now.
+ */
+ oldlen = line[0];
+ lineattrs = line[oldlen + 1];
+ line = srealloc(line, TSIZE * (2 + cols));
+ line[0] = cols;
+ for (i = oldlen; i < cols; i++)
+ line[i + 1] = ERASE_CHAR;
+ line[cols + 1] = lineattrs & LATTR_MODE;
+ }
+
+ return line;
+}
+
+/*