diff options
author | bde <bde@FreeBSD.org> | 1998-12-07 12:14:04 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-12-07 12:14:04 +0000 |
commit | c586f2866a66c71d3e30d76ad96c142ab8cfaf50 (patch) | |
tree | 7c88ccc197998ed1c295549306bed9f4d52fc3a5 /bin/sh/bltin | |
parent | 52149e1f7c8bcc13a42332e6115b42c932b81875 (diff) | |
download | FreeBSD-src-c586f2866a66c71d3e30d76ad96c142ab8cfaf50.zip FreeBSD-src-c586f2866a66c71d3e30d76ad96c142ab8cfaf50.tar.gz |
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.)
Diffstat (limited to 'bin/sh/bltin')
-rw-r--r-- | bin/sh/bltin/bltin.h | 14 |
1 files changed, 12 insertions, 2 deletions
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); \ |