summaryrefslogtreecommitdiff
path: root/src/regexp_nfa.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-11 18:42:36 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-11 18:42:36 +0200
commit16619a235bae49c11d28ac462dc2d42fcfea44ba (patch)
treea02a066c8ad452f8ee2aa0e9148fffca4dcf3c2a /src/regexp_nfa.c
parent9a773488a7113cd028151e71ab6c9cd43bf56972 (diff)
downloadvim-16619a235bae49c11d28ac462dc2d42fcfea44ba.zip
updated for version 7.3.1165
Problem: HP-UX compiler can't handle zero size array. (Charles Cooper) Solution: Make the array one item big.
Diffstat (limited to 'src/regexp_nfa.c')
-rw-r--r--src/regexp_nfa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 40208d409..df82ebf68 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -6391,8 +6391,8 @@ nfa_regcomp(expr, re_flags)
*/
post2nfa(postfix, post_ptr, TRUE);
- /* Space for compiled regexp */
- prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * nstate;
+ /* allocate the regprog with space for the compiled regexp */
+ prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * (nstate - 1);
prog = (nfa_regprog_T *)lalloc(prog_size, TRUE);
if (prog == NULL)
goto fail;