if (len >= sizeof(nbuf)) len = sizeof(nbuf) - 1;
vs_number(sp)	SCR *sp;{	GS *gp;	SMAP *smp;	VI_PRIVATE *vip;	size_t len, oldy, oldx;	int exist;	char nbuf[10];	gp = sp->gp;	vip = VIP(sp);	/* No reason to do anything if we're in input mode on the info line. */	if (F_ISSET(sp, SC_TINPUT_INFO))		return (0);	/*	 * Try and avoid getting the last line in the file, by getting the	 * line after the last line in the screen -- if it exists, we know	 * we have to to number all the lines in the screen.  Get the one	 * after the last instead of the last, so that the info line doesn't	 * fool us.  (The problem is that file_lline will lie, and tell us	 * that the info line is the last line in the file.) If that test	 * fails, we have to check each line for existence.	 */	exist = db_exist(sp, TMAP->lno + 1);	(void)gp->scr_cursor(sp, &oldy, &oldx);	for (smp = HMAP; smp <= TMAP; ++smp) {		/* Numbers are only displayed for the first screen line. */		if (O_ISSET(sp, O_LEFTRIGHT)) {			if (smp->coff != 0)				continue;		} else			if (smp->soff != 1)				continue;		/*		 * The first line of an empty file gets numbered, otherwise		 * number any existing line.		 */		if (smp->lno != 1 && !exist && !db_exist(sp, smp->lno))			break;		(void)gp->scr_move(sp, smp - HMAP, 0);		len = snprintf(nbuf, sizeof(nbuf), O_NUMBER_FMT, smp->lno);		(void)gp->scr_addstr(sp, nbuf, len);	}	(void)gp->scr_move(sp, oldy, oldx);	return (0);}