diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-20 21:32:11 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-22 20:10:11 -0500 |
commit | 0f29deec80e09b05eae97ea16edd458b440b7c0e (patch) | |
tree | f69d86dc4cda39fa7b7fd5649b9b50982484a6c9 | |
parent | d5f14b8372b3c8d441187eea659156534cb4c9ba (diff) | |
download | rneovim-0f29deec80e09b05eae97ea16edd458b440b7c0e.tar.gz rneovim-0f29deec80e09b05eae97ea16edd458b440b7c0e.tar.bz2 rneovim-0f29deec80e09b05eae97ea16edd458b440b7c0e.zip |
vim-patch:8.1.1235: compiler warnings for using STRLEN() value
Problem: Compiler warnings for using STRLEN() value.
Solution: Cast to int. (Christian Brabandt, Mike Williams)
https://github.com/vim/vim/commit/c0af78fa0869d39314336faef36239f62f09e148
-rw-r--r-- | src/nvim/tag.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 9e8c05fb1e..10efa65ddb 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1194,12 +1194,10 @@ static int find_tagfunc_tags( taglist = rettv.vval.v_list; TV_LIST_ITER_CONST(taglist, li, { - char_u *mfp; char_u *res_name; char_u *res_fname; char_u *res_cmd; char_u *res_kind; - int len; int has_extra = 0; int name_only = flags & TAG_NAMES; @@ -1208,7 +1206,7 @@ static int find_tagfunc_tags( break; } - len = 2; + size_t len = 2; res_name = NULL; res_fname = NULL; res_cmd = NULL; @@ -1254,15 +1252,7 @@ static int find_tagfunc_tags( break; } - if (name_only) { - mfp = vim_strsave(res_name); - } else { - mfp = (char_u *)xmalloc((int)sizeof(char_u) + len + 1); - } - - if (mfp == NULL) { - continue; - } + char_u *const mfp = name_only ? vim_strsave(res_name) : xmalloc(len + 2); if (!name_only) { char_u *p = mfp; |