From 667a6d104ab4dfcc19ae2fa5b062cee56c5106fe Mon Sep 17 00:00:00 2001 From: millert Date: Sun, 15 Sep 1996 22:00:26 +0000 Subject: [PATCH] fix a typo and vsprintf -> vsnprintf paranoia --- bin/csh/err.c | 6 +++--- bin/csh/printf.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/csh/err.c b/bin/csh/err.c index 278cc8e3aab..00c77a85848 100644 --- a/bin/csh/err.c +++ b/bin/csh/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.2 1996/06/23 14:19:19 deraadt Exp $ */ +/* $OpenBSD: err.c,v 1.3 1996/09/15 22:00:27 millert Exp $ */ /* $NetBSD: err.c,v 1.6 1995/03/21 09:02:47 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: err.c,v 1.2 1996/06/23 14:19:19 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: err.c,v 1.3 1996/09/15 22:00:27 millert Exp $"; #endif #endif /* not lint */ @@ -312,7 +312,7 @@ seterror(id, va_alist) #endif if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0])) id = ERR_INVALID; - vsprintf(berr, errorlist[id], va); + vsnprintf(berr, sizeof(berr), errorlist[id], va); va_end(va); seterr = strsave(berr); diff --git a/bin/csh/printf.c b/bin/csh/printf.c index 80a4871b472..a44269b597a 100644 --- a/bin/csh/printf.c +++ b/bin/csh/printf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printf.c,v 1.3 1996/08/02 12:40:52 deraadt Exp $ */ +/* $OpenBSD: printf.c,v 1.4 1996/09/15 22:00:26 millert Exp $ */ /* $NetBSD: printf.c,v 1.6 1995/03/21 09:03:15 cgd Exp $ */ /* @@ -46,7 +46,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)printf.c 8.1 (Berkeley) 7/20/93"; #else -static char rcsid[] = "$OpenBSD: printf.c,v 1.3 1996/08/02 12:40:52 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: printf.c,v 1.4 1996/09/15 22:00:26 millert Exp $"; #endif #endif /* not lint */ @@ -71,7 +71,7 @@ static char rcsid[] = "$OpenBSD: printf.c,v 1.3 1996/08/02 12:40:52 deraadt Exp #define main printfcmd #define warnx(a, b, c) { \ char buf[64]; \ - (void)sprintf(buf, sizeof(buf), a, b, c); \ + (void)snprintf(buf, sizeof(buf), a, b, c); \ error(buf); \ } #include "../../bin/sh/bltin/bltin.h" -- 2.20.1