diff options
author | James McCoy <jamessan@jamessan.com> | 2017-03-31 07:52:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-31 07:52:45 -0400 |
commit | 77539eef9baa0d070a1d07360dda2177c2ae41a7 (patch) | |
tree | c7e9e05dc4ba6e019e38610507440a75c8945fb5 /src/nvim/option.c | |
parent | 1097ba53f806c6f4f3e542af23332c556d38783f (diff) | |
parent | 338da727cdb19a15a0b001707e8778e10977e65c (diff) | |
download | rneovim-77539eef9baa0d070a1d07360dda2177c2ae41a7.tar.gz rneovim-77539eef9baa0d070a1d07360dda2177c2ae41a7.tar.bz2 rneovim-77539eef9baa0d070a1d07360dda2177c2ae41a7.zip |
Merge pull request #6397 from jamessan/coverity
Fix latest Coverity issues
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 0bf81b4d3a..0b4d9aae5d 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1054,13 +1054,15 @@ void set_init_3(void) */ void set_helplang_default(const char *lang) { - int idx; + if (lang == NULL) { + return; + } const size_t lang_len = strlen(lang); - if (lang == NULL || lang_len < 2) { // safety check + if (lang_len < 2) { // safety check return; } - idx = findoption("hlg"); + int idx = findoption("hlg"); if (idx >= 0 && !(options[idx].flags & P_WAS_SET)) { if (options[idx].flags & P_ALLOCED) free_string_option(p_hlg); |