summaryrefslogtreecommitdiffstats
path: root/contrib/one-true-awk/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/one-true-awk/lib.c')
-rw-r--r--contrib/one-true-awk/lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/one-true-awk/lib.c b/contrib/one-true-awk/lib.c
index c260a05..c306910 100644
--- a/contrib/one-true-awk/lib.c
+++ b/contrib/one-true-awk/lib.c
@@ -40,9 +40,9 @@ char *fields;
int fieldssize = RECSIZE;
Cell **fldtab; /* pointers to Cells */
-char inputFS[100] = " ";
+char inputFS[10] = " ";
-#define MAXFLD 200
+#define MAXFLD 2
int nfields = MAXFLD; /* last allocated slot for $i */
int donefld; /* 1 = implies rec broken into fields */
@@ -173,7 +173,7 @@ int getrec(char **pbuf, int *pbufsize, int isrecord) /* get next input record */
void nextfile(void)
{
- if (infile != stdin)
+ if (infile != NULL && infile != stdin)
fclose(infile);
infile = NULL;
argno++;
OpenPOWER on IntegriCloud