aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/option.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index a4cfe45f10..f30d10d0bb 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -333,7 +333,7 @@ static inline size_t compute_double_colon_len(const char *const val,
const size_t single_suf_len)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE
{
- if (val == NULL && *val) {
+ if (val == NULL || *val == NUL) {
return 0;
}
size_t ret = 0;
@@ -378,7 +378,7 @@ static inline char *add_colon_dirs(char *dest, const char *const val,
const bool forward)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ARG(1)
{
- if (val == NULL && *val) {
+ if (val == NULL || *val == NUL) {
return dest;
}
const void *iter = NULL;
@@ -435,7 +435,7 @@ static inline char *add_dir(char *dest, const char *const dir,
const char *const suf2, const size_t len2)
FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT
{
- if (dir == NULL && dir_len != 0) {
+ if (dir == NULL || dir_len == 0) {
return dest;
}
dest = strcpy_comma_escaped(dest, dir, dir_len);