memmove(p, t, len);
memcpy(p, t, len);
mod_rpt(sp)	SCR *sp;{	static char * const action[] = {		"293|added",		"294|changed",		"295|deleted",		"296|joined",		"297|moved",		"298|shifted",		"299|yanked",	};	static char * const lines[] = {		"300|line",		"301|lines",	};	recno_t total;	u_long rptval;	int first, cnt;	size_t blen, len, tlen;	const char *t;	char * const *ap;	char *bp, *p;	/* Change reports are turned off in batch mode. */	if (F_ISSET(sp, SC_EX_SILENT))		return;	/* Reset changing line number. */	sp->rptlchange = OOBLNO;	/*	 * Don't build a message if not enough changed.	 *	 * !!!	 * And now, a vi clone test.  Historically, vi reported if the number	 * of changed lines was > than the value, not >=, unless it was a yank	 * command, which used >=.  No lie.  Furthermore, an action was never	 * reported for a single line action.  This is consistent for actions	 * other than yank, but yank didn't report single line actions even if	 * the report edit option was set to 1.  In addition, setting report to	 * 0 in the 4BSD historic vi was equivalent to setting it to 1, for an	 * unknown reason (this bug was fixed in System III/V at some point).	 * I got complaints, so nvi conforms to System III/V historic practice	 * except that we report a yank of 1 line if report is set to 1.	 */#define	ARSIZE(a)	sizeof(a) / sizeof (*a)#define	MAXNUM		25	rptval = O_VAL(sp, O_REPORT);	for (cnt = 0, total = 0; cnt < ARSIZE(action); ++cnt)		total += sp->rptlines[cnt];	if (total == 0)		return;	if (total <= rptval && sp->rptlines[L_YANKED] < rptval) {		for (cnt = 0; cnt < ARSIZE(action); ++cnt)			sp->rptlines[cnt] = 0;		return;	}	/* Build and display the message. */	GET_SPACE_GOTO(sp, bp, blen, sizeof(action) * MAXNUM + 1);	for (p = bp, first = 1, tlen = 0,	    ap = action, cnt = 0; cnt < ARSIZE(action); ++ap, ++cnt)		if (sp->rptlines[cnt] != 0) {			if (first)				first = 0;			else {				*p++ = ';';				*p++ = ' ';				tlen += 2;			}			len = snprintf(p, MAXNUM, "%lu ", sp->rptlines[cnt]);			p += len;			tlen += len;			t = msg_cat(sp,			    lines[sp->rptlines[cnt] == 1 ? 0 : 1], &len);			memmove(p, t, len);			p += len;			tlen += len;			*p++ = ' ';			++tlen;			t = msg_cat(sp, *ap, &len);			memmove(p, t, len);			p += len;			tlen += len;			sp->rptlines[cnt] = 0;		}	/* Add trailing newline. */	*p = '\n';	++tlen;	(void)ex_fflush(sp);	sp->gp->scr_msg(sp, M_INFO, bp, tlen);	FREE_SPACE(sp, bp, blen);alloc_err:	return;#undef ARSIZE#undef MAXNUM}