diff options
Diffstat (limited to 'helpers/testdfa.c')
-rw-r--r-- | helpers/testdfa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/helpers/testdfa.c b/helpers/testdfa.c index 25a229a2..092a13d8 100644 --- a/helpers/testdfa.c +++ b/helpers/testdfa.c @@ -392,14 +392,14 @@ setup_pattern(const char *pattern, size_t *len) * from that. */ if (buf == NULL) { - buf = (char *) malloc(*len + 2); + buf = (char *) malloc(*len + 1); if (buf == NULL) { fprintf(stderr, "%s: malloc failed\n", __func__); exit(EXIT_FAILURE); } buflen = *len; } else if (*len > buflen) { - buf = (char *) realloc(buf, *len + 2); + buf = (char *) realloc(buf, *len + 1); if (buf == NULL) { fprintf(stderr, "%s: realloc failed\n", __func__); exit(EXIT_FAILURE); |