aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/bltin
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-12-07 12:14:04 +0000
committerBruce Evans <bde@FreeBSD.org>1998-12-07 12:14:04 +0000
commit3b53d3803e4824def99638e370f15ecbb8b2dde1 (patch)
treef1cbf1e20ffa3ec72c1554ae5e39597adc473708 /bin/sh/bltin
parent0fe8d9f3dd171c9b8184bb4c42c18cb1252d227c (diff)
downloadsrc-3b53d3803e4824def99638e370f15ecbb8b2dde1.tar.gz
src-3b53d3803e4824def99638e370f15ecbb8b2dde1.zip
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.)
Notes
Notes: svn path=/head/; revision=41582
Diffstat (limited to 'bin/sh/bltin')
-rw-r--r--bin/sh/bltin/bltin.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index a50d55cb3d9e..ebd035a650de 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); \