diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-12 16:19:50 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-19 14:50:26 -0300 |
commit | e303a11ebfc352860cce73184ece692ab4d0f01c (patch) | |
tree | 67a3e4b7a8d6633149f9d22f3f51cd96498aacd4 /src/nvim/screen.c | |
parent | 7a830d945fb44a850b7cef65971f37a570a36e9e (diff) | |
download | rneovim-e303a11ebfc352860cce73184ece692ab4d0f01c.tar.gz rneovim-e303a11ebfc352860cce73184ece692ab4d0f01c.tar.bz2 rneovim-e303a11ebfc352860cce73184ece692ab4d0f01c.zip |
Remove OOM checks: suggested changes in review
- Replace a vim_strsave/free pair with xrealloc
- Use xmallocz() in some places
- Use xrealloc() and forget about the NULL pointer case
- Remove invalid comment
- Remove unnecessary checks
- Replace a complicated xmalloc/STRCPY/free code chunk code with xrealloc()
- Replace a vim_strsave/free code chunk with xrealloc()
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 53b2baf1bb..af3f5c999f 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -4691,10 +4691,7 @@ win_redr_status_matches ( if (matches == NULL) /* interrupted completion? */ return; - if (has_mbyte) - buf = xmalloc(Columns * MB_MAXBYTES + 1); - else - buf = xmalloc(Columns + 1); + buf = xmalloc(has_mbyte ? Columns * MB_MAXBYTES + 1 : Columns + 1); if (match == -1) { /* don't show match but original text */ match = 0; |