aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoronetrueawk <bwkster@gmail.com>2019-01-21 14:12:05 -0500
committerGitHub <noreply@github.com>2019-01-21 14:12:05 -0500
commitf70e36869ea55f9c19d328d4e910fa6a8d77d6da (patch)
tree13bfbb578a289a0d97b0b7801f9d811c942b0abf
parent55d20ec4e198c05b57fcba14e8f07ca8d65748b8 (diff)
parent7580235939d2c4f300827b9444675f35341a00e0 (diff)
downloadplatform_external_one-true-awk-f70e36869ea55f9c19d328d4e910fa6a8d77d6da.tar.gz
platform_external_one-true-awk-f70e36869ea55f9c19d328d4e910fa6a8d77d6da.tar.bz2
platform_external_one-true-awk-f70e36869ea55f9c19d328d4e910fa6a8d77d6da.zip
Merge pull request #24 from melloc/fields-init
Fix initial "fields" buffer size
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index ba6ebd4..247ec9a 100644
--- a/lib.c
+++ b/lib.c
@@ -59,7 +59,7 @@ void recinit(unsigned int n)
{
if ( (record = (char *) malloc(n)) == NULL
|| (fields = (char *) malloc(n+1)) == NULL
- || (fldtab = (Cell **) malloc((nfields+1) * sizeof(Cell *))) == NULL
+ || (fldtab = (Cell **) malloc((nfields+2) * sizeof(Cell *))) == NULL
|| (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL )
FATAL("out of space for $0 and fields");
*fldtab[0] = dollar0;