Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
6936:6f7f9d8992a1 | 6937:c31bd9ca75d2 |
---|---|
8289 | 8289 |
8290 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) | 8290 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) |
8291 if (!starting) | 8291 if (!starting) |
8292 { | 8292 { |
8293 char_u buf_old[2], buf_new[2], buf_type[7]; | 8293 char_u buf_old[2], buf_new[2], buf_type[7]; |
8294 snprintf((char *)buf_old, 2, "%d", old_value ? TRUE: FALSE); | 8294 vim_snprintf((char *)buf_old, 2, "%d", old_value ? TRUE: FALSE); |
8295 snprintf((char *)buf_new, 2, "%d", value ? TRUE: FALSE); | 8295 vim_snprintf((char *)buf_new, 2, "%d", value ? TRUE: FALSE); |
8296 sprintf((char *)buf_type, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); | 8296 vim_snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); |
8297 set_vim_var_string(VV_OPTION_NEW, buf_new, -1); | 8297 set_vim_var_string(VV_OPTION_NEW, buf_new, -1); |
8298 set_vim_var_string(VV_OPTION_OLD, buf_old, -1); | 8298 set_vim_var_string(VV_OPTION_OLD, buf_old, -1); |
8299 set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); | 8299 set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); |
8300 apply_autocmds(EVENT_OPTIONSET, (char_u *) options[opt_idx].fullname, NULL, FALSE, NULL); | 8300 apply_autocmds(EVENT_OPTIONSET, (char_u *) options[opt_idx].fullname, NULL, FALSE, NULL); |
8301 reset_v_option_vars(); | 8301 reset_v_option_vars(); |
8839 | 8839 |
8840 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) | 8840 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) |
8841 if (!starting && errmsg == NULL) | 8841 if (!starting && errmsg == NULL) |
8842 { | 8842 { |
8843 char_u buf_old[11], buf_new[11], buf_type[7]; | 8843 char_u buf_old[11], buf_new[11], buf_type[7]; |
8844 snprintf((char *)buf_old, 10, "%ld", old_value); | 8844 vim_snprintf((char *)buf_old, 10, "%ld", old_value); |
8845 snprintf((char *)buf_new, 10, "%ld", value); | 8845 vim_snprintf((char *)buf_new, 10, "%ld", value); |
8846 snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); | 8846 vim_snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global"); |
8847 set_vim_var_string(VV_OPTION_NEW, buf_new, -1); | 8847 set_vim_var_string(VV_OPTION_NEW, buf_new, -1); |
8848 set_vim_var_string(VV_OPTION_OLD, buf_old, -1); | 8848 set_vim_var_string(VV_OPTION_OLD, buf_old, -1); |
8849 set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); | 8849 set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); |
8850 apply_autocmds(EVENT_OPTIONSET, (char_u *) options[opt_idx].fullname, NULL, FALSE, NULL); | 8850 apply_autocmds(EVENT_OPTIONSET, (char_u *) options[opt_idx].fullname, NULL, FALSE, NULL); |
8851 reset_v_option_vars(); | 8851 reset_v_option_vars(); |