Skip to content

Commit

Permalink
Merge pull request lh3#24 from melloc/fields-init
Browse files Browse the repository at this point in the history
Fix initial "fields" buffer size
  • Loading branch information
onetrueawk authored Jan 21, 2019
2 parents 55d20ec + 7580235 commit f70e368
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f70e368

Please sign in to comment.