memmove(line->chars + line->cols, line->chars + oldlen, (line->size - line->cols) * TSIZE);
if (cols > oldcols) memmove(line->chars + cols, line->chars + oldcols, (line->size - line->cols) * TSIZE);
static void resizeline(Terminal *term, termline *line, int cols){    int i, oldlen;    if (line->cols != cols) {	/*	 * This line is the wrong length, which probably means it	 * hasn't been accessed since a resize. Resize it now.	 * 	 * First, go through all the characters that will be thrown	 * out in the resize (if we're shrinking the line) and	 * return their cc lists to the cc free list.	 */	for (i = cols; i < line->cols; i++)	    clear_cc(line, i);	/*	 * Now do the actual resize, leaving the _same_ amount of	 * cc space as there was to begin with.	 */	oldlen = line->cols;	line->size += cols - oldlen;	line->chars = sresize(line->chars, line->size, TTYPE);	line->cols = cols;	/*	 * Bodily move the entire cc section from where it started	 * to where it now needs to be.	 */	memmove(line->chars + line->cols, line->chars + oldlen,		(line->size - line->cols) * TSIZE);	/*	 * Go through what's left of the original line, and adjust	 * the first cc_next pointer in each list. (All the	 * subsequent ones are still valid because they are	 * relative offsets within the cc block.) Also do the same	 * to the head of the cc_free list.	 */	for (i = 0; i < oldlen && i < line->cols; i++)	    if (line->chars[i].cc_next)		line->chars[i].cc_next += cols - oldlen;	if (line->cc_free)	    line->cc_free += cols - oldlen;	/*	 * And finally fill in the new space with erase chars. (We	 * don't have to worry about cc lists here, because we	 * _know_ the erase char doesn't have one.)	 */	for (i = oldlen; i < cols; i++)	    line->chars[i] = term->basic_erase_char;	cc_check(line);		       /* XXX-REMOVE-BEFORE-RELEASE */    }}