diff options
author | John Schmidt <john.schmidt.h@gmail.com> | 2014-04-09 01:05:48 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-10 17:03:50 -0300 |
commit | 3fcdb2ab29f6285b4b5b4fd706db54a98b1a773f (patch) | |
tree | 0b4486d8e2f44c505ea59102b45385e682a6a98e /src/misc1.c | |
parent | 321c67d610f0e0a8e818cfbb10d966033eb7db58 (diff) | |
download | rneovim-3fcdb2ab29f6285b4b5b4fd706db54a98b1a773f.tar.gz rneovim-3fcdb2ab29f6285b4b5b4fd706db54a98b1a773f.tar.bz2 rneovim-3fcdb2ab29f6285b4b5b4fd706db54a98b1a773f.zip |
Replace `alloc_check` by `xmalloc`
`alloc_check` is just a wrapper around xmalloc, so we can remove it and use
xmalloc directly. ref #487 / #488
The call was replaced in the following files:
- ex_cmds.c
- misc1.c
- ops.c
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/misc1.c b/src/misc1.c index e83314c156..180c658064 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -1510,9 +1510,7 @@ void ins_char_bytes(char_u *buf, int charlen) } } - newp = alloc_check((unsigned)(linelen + newlen - oldlen)); - if (newp == NULL) - return; + newp = (char_u *) xmalloc((size_t)(linelen + newlen - oldlen)); /* Copy bytes before the cursor. */ if (col > 0) @@ -1580,9 +1578,7 @@ void ins_str(char_u *s) oldp = ml_get(lnum); oldlen = (int)STRLEN(oldp); - newp = alloc_check((unsigned)(oldlen + newlen + 1)); - if (newp == NULL) - return; + newp = (char_u *) xmalloc((size_t)(oldlen + newlen + 1)); if (col > 0) memmove(newp, oldp, (size_t)col); memmove(newp + col, s, (size_t)newlen); |