refactor: missing parenthesis may cause unexpected problems (#17443)

related vim-8.2.{4402,4639}
This commit is contained in:
kylo252
2022-05-26 04:49:25 +02:00
committed by GitHub
parent f246a929e7
commit 7b952793d5
18 changed files with 132 additions and 127 deletions

View File

@@ -146,7 +146,7 @@ char *vim_strnsave_unquoted(const char *const string, const size_t length)
FUNC_ATTR_NONNULL_RET
{
#define ESCAPE_COND(p, inquote, string_end) \
(*p == '\\' && inquote && p + 1 < string_end && (p[1] == '\\' || p[1] == '"'))
(*(p) == '\\' && (inquote) && (p) + 1 < (string_end) && ((p)[1] == '\\' || (p)[1] == '"'))
size_t ret_length = 0;
bool inquote = false;
const char *const string_end = string + length;