summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorkylo252 <59826753+kylo252@users.noreply.github.com>2022-02-16 19:24:07 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-16 19:24:07 +0000
commitae6f1d8b14c2f63811ee83ef14e32086fb3e9b83 (patch)
tree4982335c2afa3ef8515860dabea038acbc2af406 /src/charset.c
parentd288eaad846f0e07e0141226f97d858dcf96cb78 (diff)
patch 8.2.4402: missing parenthesis may cause unexpected problemsv8.2.4402
Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. (closes #9788)
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/charset.c b/src/charset.c
index df95ed1b50..2ecb96c894 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -386,9 +386,9 @@ str_foldcase(
int len = orglen;
#define GA_CHAR(i) ((char_u *)ga.ga_data)[i]
-#define GA_PTR(i) ((char_u *)ga.ga_data + i)
+#define GA_PTR(i) ((char_u *)ga.ga_data + (i))
#define STR_CHAR(i) (buf == NULL ? GA_CHAR(i) : buf[i])
-#define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + i)
+#define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + (i))
// Copy "str" into "buf" or allocated memory, unmodified.
if (buf == NULL)
@@ -706,7 +706,7 @@ vim_strnsize(char_u *s, int len)
#ifdef FEAT_VARTABS
# define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \
- if (*(p) == TAB && (!(wp)->w_p_list || wp->w_lcs_chars.tab1)) \
+ if (*(p) == TAB && (!(wp)->w_p_list || (wp)->w_lcs_chars.tab1)) \
{ \
return tabstop_padding(col, (buf)->b_p_ts, (buf)->b_p_vts_array); \
} \