diff options
-rw-r--r-- | src/nvim/option.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 6ec0d4a095..3e74d4d23c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1798,8 +1798,8 @@ do_set ( if (saved_origval != NULL) { char_u buf_type[7]; - sprintf((char *)buf_type, "%s", - (opt_flags & OPT_LOCAL) ? "local" : "global"); + vim_snprintf((char *)buf_type, 7, "%s", + (opt_flags & OPT_LOCAL) ? "local" : "global"); set_vim_var_string(VV_OPTION_NEW, *(char_u **)varp, -1); set_vim_var_string(VV_OPTION_OLD, saved_origval, -1); @@ -2385,8 +2385,8 @@ set_string_option ( // call autocommand after handling side effects if (saved_oldval != NULL) { char_u buf_type[7]; - sprintf((char *)buf_type, "%s", - (opt_flags & OPT_LOCAL) ? "local" : "global"); + vim_snprintf((char *)buf_type, 7, "%s", + (opt_flags & OPT_LOCAL) ? "local" : "global"); set_vim_var_string(VV_OPTION_NEW, *varp, -1); set_vim_var_string(VV_OPTION_OLD, saved_oldval, -1); set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); |