diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-05-22 12:50:59 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-22 13:00:51 -0400 |
commit | e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72 (patch) | |
tree | 6ff1b06b5d5fd6d3260f3a778c33cfaf03f0c295 /src/nvim/regexp_nfa.c | |
parent | 0aa8b5828cc0674894681841f40c3c05bfd2f07b (diff) | |
parent | e303a11ebfc352860cce73184ece692ab4d0f01c (diff) | |
download | rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.gz rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.bz2 rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.zip |
Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'
- replace alloc with xmalloc
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r-- | src/nvim/regexp_nfa.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 9855092ab4..d263a000d7 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -516,7 +516,7 @@ static char_u *nfa_get_match_text(nfa_state_T *start) if (p->c != NFA_MCLOSE || p->out->c != NFA_MATCH) return NULL; - ret = alloc(len); + ret = xmalloc(len); p = start->out->out; /* skip first char, it goes into regstart */ s = ret; while (p->c > 0) { @@ -4193,10 +4193,9 @@ addstate_here ( if (l->n + count - 1 >= l->len) { /* not enough space to move the new states, reallocate the list * and move the states to the right position */ - nfa_thread_T *newl; l->len = l->len * 3 / 2 + 50; - newl = (nfa_thread_T *)alloc(l->len * sizeof(nfa_thread_T)); + nfa_thread_T *newl = xmalloc(l->len * sizeof(nfa_thread_T)); memmove(&(newl[0]), &(l->t[0]), sizeof(nfa_thread_T) * listidx); |