aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-12-23 14:03:03 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-12-23 14:03:03 +0200
commit15e58aea1441250cb85f760e644f97cd6efed35f (patch)
tree4d4621051b33c22043ea773658045bb623abd2b9
parent7627ab595b5e4f7e44f3924345b6ba8a7043c482 (diff)
downloadegawk-15e58aea1441250cb85f760e644f97cd6efed35f.tar.gz
egawk-15e58aea1441250cb85f760e644f97cd6efed35f.tar.bz2
egawk-15e58aea1441250cb85f760e644f97cd6efed35f.zip
Bug fix for sprintf/printf. Minor edit in awkgram.y.
-rw-r--r--ChangeLog6
-rw-r--r--awkgram.c2
-rw-r--r--awkgram.y2
-rw-r--r--builtin.c3
4 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d252680..7982a697 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (tokentab): Whitespace fix for "include".
+ * builtin.c (printf_common): Do a fatal error if no args to printf()
+ or sprintf().
+
2012-12-15 Arnold D. Robbins <arnold@skeeve.com>
Infrastructure Updates:
diff --git a/awkgram.c b/awkgram.c
index 73d48956..d9387e25 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4362,7 +4362,7 @@ static const struct token tokentab[] = {
{"gsub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0},
{"if", Op_K_if, LEX_IF, 0, 0},
{"in", Op_symbol, LEX_IN, 0, 0},
-{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0},
+{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0},
{"index", Op_builtin, LEX_BUILTIN, A(2), do_index},
{"int", Op_builtin, LEX_BUILTIN, A(1), do_int},
{"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray},
diff --git a/awkgram.y b/awkgram.y
index cd1c092e..00569b2a 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1851,7 +1851,7 @@ static const struct token tokentab[] = {
{"gsub", Op_sub_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), 0},
{"if", Op_K_if, LEX_IF, 0, 0},
{"in", Op_symbol, LEX_IN, 0, 0},
-{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0},
+{"include", Op_symbol, LEX_INCLUDE, GAWKX, 0},
{"index", Op_builtin, LEX_BUILTIN, A(2), do_index},
{"int", Op_builtin, LEX_BUILTIN, A(1), do_int},
{"isarray", Op_builtin, LEX_BUILTIN, GAWKX|A(1), do_isarray},
diff --git a/builtin.c b/builtin.c
index be99cbca..db51dbdc 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1392,6 +1392,9 @@ printf_common(int nargs)
int i;
NODE *r, *tmp;
+ if (nargs == 0)
+ fatal(_("[s]printf called with no arguments"));
+
assert(nargs <= max_args);
for (i = 1; i <= nargs; i++) {
tmp = args_array[nargs - i] = POP();