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/ui.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/ui.c')
-rw-r--r-- | src/nvim/ui.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index a1254ea04f..6d27822bc0 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -272,12 +272,10 @@ int vim_is_input_buf_empty(void) */ char_u *get_input_buf(void) { - garray_T *gap; - /* We use a growarray to store the data pointer and the length. */ - gap = (garray_T *)alloc((unsigned)sizeof(garray_T)); + garray_T *gap = xmalloc(sizeof(garray_T)); /* Add one to avoid a zero size. */ - gap->ga_data = alloc((unsigned)inbufcount + 1); + gap->ga_data = xmalloc(inbufcount + 1); if (gap->ga_data != NULL) memmove(gap->ga_data, inbuf, (size_t)inbufcount); gap->ga_len = inbufcount; |