diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-09 03:30:26 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-19 14:50:23 -0300 |
commit | 21784aeb005e78f04f4c1d398bc486be0a65248e (patch) | |
tree | 5180a6de4bd033571e351d06b04419a3af768198 /src/nvim/indent.c | |
parent | a80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (diff) | |
download | rneovim-21784aeb005e78f04f4c1d398bc486be0a65248e.tar.gz rneovim-21784aeb005e78f04f4c1d398bc486be0a65248e.tar.bz2 rneovim-21784aeb005e78f04f4c1d398bc486be0a65248e.zip |
Replace alloc() with xmalloc() and remove immediate OOM checks
Diffstat (limited to 'src/nvim/indent.c')
-rw-r--r-- | src/nvim/indent.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/indent.c b/src/nvim/indent.c index aa02efe5b2..06273e98c2 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -182,7 +182,7 @@ int set_indent(int size, int flags) // characters and allocate accordingly. We will fill the rest with spaces // after the if (!curbuf->b_p_et) below. if (orig_char_len != -1) { - newline = alloc(orig_char_len + size - ind_done + line_len); + newline = xmalloc(orig_char_len + size - ind_done + line_len); todo = size - ind_done; // Set total length of indent in characters, which may have been @@ -203,7 +203,7 @@ int set_indent(int size, int flags) } } else { todo = size; - newline = alloc(ind_len + line_len); + newline = xmalloc(ind_len + line_len); s = newline; } @@ -368,7 +368,7 @@ int copy_indent(int size, char_u *src) // Allocate memory for the result: the copied indent, new indent // and the rest of the line. line_len = (int)STRLEN(ml_get_curline()) + 1; - line = alloc(ind_len + line_len); + line = xmalloc(ind_len + line_len); p = line; } } |