From c586f2866a66c71d3e30d76ad96c142ab8cfaf50 Mon Sep 17 00:00:00 2001 From: bde Date: Mon, 7 Dec 1998 12:14:04 +0000 Subject: Fixed warnx format errors in printf and csh, and snprintf format errors in sh, by using separate macros for the 1, 2 and 3-arg calls to warnx. (The 3-arg warnx macro in sh/bltin/bltin.h used to require bogus dummy args.) --- bin/sh/bltin/bltin.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin/sh') diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h index a50d55c..ebd035a 100644 --- a/bin/sh/bltin/bltin.h +++ b/bin/sh/bltin/bltin.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)bltin.h 8.2 (Berkeley) 5/4/95 - * $Id$ + * $Id: bltin.h,v 1.8 1997/02/22 13:58:58 peter Exp $ */ /* @@ -60,7 +60,17 @@ #define fputs outstr #define fflush flushout #define INITARGS(argv) -#define warnx(a, b, c) { \ +#define warnx1(a, b, c) { \ + char buf[64]; \ + (void)snprintf(buf, sizeof(buf), a); \ + error("%s", buf); \ +} +#define warnx2(a, b, c) { \ + char buf[64]; \ + (void)snprintf(buf, sizeof(buf), a, b); \ + error("%s", buf); \ +} +#define warnx3(a, b, c) { \ char buf[64]; \ (void)snprintf(buf, sizeof(buf), a, b, c); \ error("%s", buf); \ -- cgit v1.1