diff options
author | obrien <obrien@FreeBSD.org> | 2007-10-25 12:38:02 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2007-10-25 12:38:02 +0000 |
commit | 9227abab1db8112427f5c46511a467cb8d6467d4 (patch) | |
tree | 4802d08923bb0ee17354898d227a094db941cabf /contrib/one-true-awk/lib.c | |
parent | d187e809f9751c4d3f4b00ef5abc4e8e90c816f0 (diff) | |
download | FreeBSD-src-9227abab1db8112427f5c46511a467cb8d6467d4.zip FreeBSD-src-9227abab1db8112427f5c46511a467cb8d6467d4.tar.gz |
Vendor import of bwk's 23-Oct-2007 release.
This includes fixes for FreeBSD PR's: bin/104795, bin/100443
Diffstat (limited to 'contrib/one-true-awk/lib.c')
-rw-r--r-- | contrib/one-true-awk/lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/one-true-awk/lib.c b/contrib/one-true-awk/lib.c index c306910..c9cc5d5 100644 --- a/contrib/one-true-awk/lib.c +++ b/contrib/one-true-awk/lib.c @@ -40,7 +40,7 @@ char *fields; int fieldssize = RECSIZE; Cell **fldtab; /* pointers to Cells */ -char inputFS[10] = " "; +char inputFS[100] = " "; #define MAXFLD 2 int nfields = MAXFLD; /* last allocated slot for $i */ @@ -58,7 +58,7 @@ static Cell dollar1 = { OCELL, CFLD, NULL, "", 0.0, FLD|STR|DONTFREE }; void recinit(unsigned int n) { if ( (record = (char *) malloc(n)) == NULL - || (fields = (char *) malloc(n)) == NULL + || (fields = (char *) malloc(n+1)) == NULL || (fldtab = (Cell **) malloc((nfields+1) * sizeof(Cell *))) == NULL || (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL ) FATAL("out of space for $0 and fields"); |