diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-12-23 14:03:03 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-12-23 14:03:03 +0200 |
commit | 15e58aea1441250cb85f760e644f97cd6efed35f (patch) | |
tree | 4d4621051b33c22043ea773658045bb623abd2b9 | |
parent | 7627ab595b5e4f7e44f3924345b6ba8a7043c482 (diff) | |
download | egawk-15e58aea1441250cb85f760e644f97cd6efed35f.tar.gz egawk-15e58aea1441250cb85f760e644f97cd6efed35f.tar.bz2 egawk-15e58aea1441250cb85f760e644f97cd6efed35f.zip |
Bug fix for sprintf/printf. Minor edit in awkgram.y.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | awkgram.c | 2 | ||||
-rw-r--r-- | awkgram.y | 2 | ||||
-rw-r--r-- | builtin.c | 3 |
4 files changed, 11 insertions, 2 deletions
@@ -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: @@ -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}, @@ -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}, @@ -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(); |