Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/historical/nawk/dist Now that inputFS is dynamicall...



details:   https://anonhg.NetBSD.org/src/rev/20c5ef567fd2
branches:  trunk
changeset: 1009239:20c5ef567fd2
user:      ad <ad%NetBSD.org@localhost>
date:      Fri Apr 17 22:35:18 2020 +0000

description:
Now that inputFS is dynamically allocated, make sure it's always non-NULL.
Fixes core dumps when building CDE.

diffstat:

 external/historical/nawk/dist/lib.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r e2c9559fffc1 -r 20c5ef567fd2 external/historical/nawk/dist/lib.c
--- a/external/historical/nawk/dist/lib.c       Fri Apr 17 19:42:14 2020 +0000
+++ b/external/historical/nawk/dist/lib.c       Fri Apr 17 22:35:18 2020 +0000
@@ -48,7 +48,7 @@
 
 Cell   **fldtab;       /* pointers to Cells */
 static size_t  len_inputFS = 0;
-static char    *inputFS = NULL; /* FS at time of input, for field splitting */
+static char    *inputFS; /* FS at time of input, for field splitting */
 
 #define        MAXFLD  2
 int    nfields = MAXFLD;       /* last allocated slot for $i */
@@ -75,6 +75,7 @@
        fldtab[0]->sval = record;
        fldtab[0]->nval = tostring("0");
        makefields(1, nfields);
+       inputFS = strdup("");
 }
 
 void makefields(int n1, int n2)                /* create $n1..$n2 inclusive */



Home | Main Index | Thread Index | Old Index