aboutsummaryrefslogtreecommitdiff
path: root/contrib/one-true-awk/tran.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-02-19 09:35:25 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-02-19 09:35:25 +0000
commit007c6572bf0688ef0c45f52e09a39c4f52ab5711 (patch)
tree24b656463efaffbd4264824c36a5e66e8ada0979 /contrib/one-true-awk/tran.c
parent82b279f73ed7957afcdd674c5e5ec38b992382e4 (diff)
Vendor import of bwk's 2002-02-18 release. Most significant update is the
inclusion of my character class patch.
Notes
Notes: svn path=/vendor/one-true-awk/dist/; revision=90902
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 8e0faf0d82d9..a44d5720df0f 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')