Fix initial "fields" buffer size
This commit is contained in:
parent
2dc7e5ff1a
commit
7580235939
2
lib.c
2
lib.c
|
@ -59,7 +59,7 @@ void recinit(unsigned int n)
|
||||||
{
|
{
|
||||||
if ( (record = (char *) malloc(n)) == NULL
|
if ( (record = (char *) malloc(n)) == NULL
|
||||||
|| (fields = (char *) malloc(n+1)) == 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 )
|
|| (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL )
|
||||||
FATAL("out of space for $0 and fields");
|
FATAL("out of space for $0 and fields");
|
||||||
*fldtab[0] = dollar0;
|
*fldtab[0] = dollar0;
|
||||||
|
|
Loading…
Reference in New Issue