From 92d620ad92bb86454a35e150e34e30cbb04fe56b Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 18 Dec 2023 16:27:02 -0500 Subject: [PATCH] fix(set_bool_option): use int value to make bool Object Boolean options are stored in an int, not a char, so dereferencing "char *varp" is not portable to big-endian systems. --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 4658ca4a3a..44a4ec2843 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2248,7 +2248,7 @@ static const char *set_bool_option(const int opt_idx, char *const varp, const in if (options[opt_idx].flags & P_UI_OPTION) { ui_call_option_set(cstr_as_string(options[opt_idx].fullname), - BOOLEAN_OBJ(*varp)); + BOOLEAN_OBJ(*(int *)varp)); } if ((int *)varp == &p_ru || (int *)varp == &p_sc) { // in case 'ruler' or 'showcmd' changed