summaryrefslogtreecommitdiffstats
path: root/contrib/one-true-awk/tran.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-19 09:35:25 +0000
committerdes <des@FreeBSD.org>2002-02-19 09:35:25 +0000
commit15169bd09781aa4d3f09d050d40b381b29c965a4 (patch)
tree24b656463efaffbd4264824c36a5e66e8ada0979 /contrib/one-true-awk/tran.c
parent4faba9a77fb780a1126a1292d4b156a42537db50 (diff)
downloadFreeBSD-src-15169bd09781aa4d3f09d050d40b381b29c965a4.zip
FreeBSD-src-15169bd09781aa4d3f09d050d40b381b29c965a4.tar.gz
Vendor import of bwk's 2002-02-18 release. Most significant update is the
inclusion of my character class patch.
Diffstat (limited to 'contrib/one-true-awk/tran.c')
-rw-r--r--contrib/one-true-awk/tran.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/one-true-awk/tran.c b/contrib/one-true-awk/tran.c
index 8e0faf0..a44d572 100644
--- a/contrib/one-true-awk/tran.c
+++ b/contrib/one-true-awk/tran.c
@@ -170,9 +170,12 @@ void freesymtab(Cell *ap) /* free a symbol table */
xfree(cp->sval);
temp = cp->cnext; /* avoids freeing then using */
free(cp);
+ tp->nelem--;
}
tp->tab[i] = 0;
}
+ if (tp->nelem != 0)
+ WARNING("can't happen: inconsistent element count freeing %s", ap->nval);
free(tp->tab);
free(tp);
}
@@ -396,7 +399,7 @@ char *qstring(char *is, int delim) /* collect string up to next delim */
uschar *s = (uschar *) is;
uschar *buf, *bp;
- if ((buf = (uschar *) malloc(strlen(s)+3)) == NULL)
+ if ((buf = (uschar *) malloc(strlen(is)+3)) == NULL)
FATAL( "out of space in qstring(%s)", s);
for (bp = buf; (c = *s) != delim; s++) {
if (c == '\n')
OpenPOWER on IntegriCloud