display.c: sprintf -> snprintf

top.c: fix from NetBSD/OpenBSD: make sure that new_message() is called
with a format.

Add $FreeBSD$ While I'm here.

These files are already off the vendor branch.
This commit is contained in:
Warner Losh 2000-10-04 23:34:16 +00:00
parent 41b3e8e5bf
commit 1e3661ab60
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66641
2 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,8 @@
*
* Copyright (c) 1984, 1989, William LeFebvre, Rice University
* Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
*
* $FreeBSD$
*/
/*
@ -829,7 +831,7 @@ caddr_t a1, a2, a3;
register int i;
/* first, format the message */
(void) sprintf(next_msg, msgfmt, a1, a2, a3);
(void) snprintf(next_msg, sizeof(next_msg), msgfmt, a1, a2, a3);
if (msglen > 0)
{

View File

@ -10,6 +10,8 @@ char *copyright =
*
* Copyright (c) 1984, 1989, William LeFebvre, Rice University
* Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
*
* $FreeBSD$
*/
/*
@ -807,7 +809,7 @@ Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n",
{
if ((errmsg = kill_procs(tempbuf2)) != NULL)
{
new_message(MT_standout, errmsg);
new_message(MT_standout, "%s", errmsg);
putchar('\r');
no_command = Yes;
}