4 ===================================================================
5 RCS file: /home/ncvs/src/contrib/one-true-awk/lib.c,v
6 retrieving revision 1.1.1.4
7 diff -u -p -r1.1.1.4 lib.c
8 --- lib.c 16 May 2005 19:11:33 -0000 1.1.1.4
9 +++ lib.c 15 Sep 2006 10:10:59 -0000
10 @@ -58,7 +58,7 @@ static Cell dollar1 = { OCELL, CFLD, NUL
11 void recinit(unsigned int n)
13 if ( (record = (char *) malloc(n)) == NULL
14 - || (fields = (char *) malloc(n)) == NULL
15 + || (fields = (char *) malloc(n+1)) == NULL
16 || (fldtab = (Cell **) malloc((nfields+1) * sizeof(Cell *))) == NULL
17 || (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL )
18 FATAL("out of space for $0 and fields");