- widen gototab so NCHARS states fits.

- don't allocate more space than we need.
From Aleksey Cheusov
This commit is contained in:
christos 2006-06-26 13:10:47 +00:00
parent 3ce3b9b485
commit 80f0134faf
2 changed files with 2 additions and 2 deletions

2
dist/nawk/awk.h vendored
View File

@ -216,7 +216,7 @@ typedef struct rrow {
} rrow;
typedef struct fa {
uschar **gototab;
unsigned short **gototab;
uschar *out;
uschar *restr;
int **posns;

2
dist/nawk/b.c vendored
View File

@ -103,7 +103,7 @@ resize_state(fa *fa, int state)
fa->posns = p;
for (i = fa->state_count; i < new_count; ++i) {
fa->gototab[i] = calloc(1, NCHARS * sizeof (*fa->gototab));
fa->gototab[i] = calloc(1, NCHARS * sizeof (**fa->gototab));
if (fa->gototab[i] == NULL)
goto out;
fa->out[i] = 0;