Mercurial > vim
diff src/option.c @ 6937:c31bd9ca75d2 v7.4.787
patch 7.4.787
Problem: snprintf() isn't available everywhere.
Solution: Use vim_snprintf(). (Ken Takata)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 17 Jul 2015 22:04:48 +0200 |
parents | 4db70c94226b |
children | ca0990adc2e3 |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -8291,9 +8291,9 @@ set_bool_option(opt_idx, varp, value, op if (!starting) { char_u buf_old[2], buf_new[2], buf_type[7]; - snprintf((char *)buf_old, 2, "%d", old_value ? TRUE: FALSE); - snprintf((char *)buf_new, 2, "%d", value ? TRUE: FALSE); - sprintf((char *)buf_type, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); + vim_snprintf((char *)buf_old, 2, "%d", old_value ? TRUE: FALSE); + vim_snprintf((char *)buf_new, 2, "%d", value ? TRUE: FALSE); + vim_snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); set_vim_var_string(VV_OPTION_NEW, buf_new, -1); set_vim_var_string(VV_OPTION_OLD, buf_old, -1); set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); @@ -8841,9 +8841,9 @@ set_num_option(opt_idx, varp, value, err if (!starting && errmsg == NULL) { char_u buf_old[11], buf_new[11], buf_type[7]; - snprintf((char *)buf_old, 10, "%ld", old_value); - snprintf((char *)buf_new, 10, "%ld", value); - snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); + vim_snprintf((char *)buf_old, 10, "%ld", old_value); + vim_snprintf((char *)buf_new, 10, "%ld", value); + vim_snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); set_vim_var_string(VV_OPTION_NEW, buf_new, -1); set_vim_var_string(VV_OPTION_OLD, buf_old, -1); set_vim_var_string(VV_OPTION_TYPE, buf_type, -1);