Mercurial > vim
comparison src/optionstr.c @ 19675:bee179e81f28 v8.2.0394
patch 8.2.0394: Coverity complains about using NULL pointer
Commit: https://github.com/vim/vim/commit/7f009dfa064240d9024b76212535a35231912511
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 16 20:27:38 2020 +0100
patch 8.2.0394: Coverity complains about using NULL pointer
Problem: Coverity complains about using NULL pointer.
Solution: Use empty string when option value is NULL.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 16 Mar 2020 20:30:04 +0100 |
parents | ce8c47ed54e5 |
children | 9a67d41708d2 |
comparison
equal
deleted
inserted
replaced
19674:8ece63e7632a | 19675:bee179e81f28 |
---|---|
498 int value_checked = FALSE; | 498 int value_checked = FALSE; |
499 | 499 |
500 if (is_hidden_option(opt_idx)) // don't set hidden option | 500 if (is_hidden_option(opt_idx)) // don't set hidden option |
501 return NULL; | 501 return NULL; |
502 | 502 |
503 s = vim_strsave(value); | 503 s = vim_strsave(value == NULL ? (char_u *)"" : value); |
504 if (s != NULL) | 504 if (s != NULL) |
505 { | 505 { |
506 varp = (char_u **)get_option_varp_scope(opt_idx, | 506 varp = (char_u **)get_option_varp_scope(opt_idx, |
507 (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0 | 507 (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0 |
508 ? (is_global_local_option(opt_idx) | 508 ? (is_global_local_option(opt_idx) |