aboutsummaryrefslogtreecommitdiff
path: root/lib.c
diff options
context:
space:
mode:
authorCody Peter Mello <melloc@writev.io>2018-11-12 10:34:19 -0800
committerCody Peter Mello <melloc@writev.io>2018-11-12 10:34:19 -0800
commit7580235939d2c4f300827b9444675f35341a00e0 (patch)
tree1ca92d7c5586c9e95f21d8ae46f1a11a1b85d887 /lib.c
parent2dc7e5ff1a4feeeb549f32706cf34e17aba89192 (diff)
downloadone-true-awk-7580235939d2c4f300827b9444675f35341a00e0.tar.gz
Fix initial "fields" buffer size
Diffstat (limited to 'lib.c')
-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;