]> granicus.if.org Git - vim/commitdiff
patch 7.4.787 v7.4.787
authorBram Moolenaar <Bram@vim.org>
Fri, 17 Jul 2015 20:04:48 +0000 (22:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 17 Jul 2015 20:04:48 +0000 (22:04 +0200)
Problem:    snprintf() isn't available everywhere.
Solution:   Use vim_snprintf(). (Ken Takata)

src/option.c
src/version.c

index c51d082498d97bc40053f45e2584f2687088148a..8b6393860e92c1c47e2ceda2c3bb121bd9befa06 100644 (file)
@@ -8291,9 +8291,9 @@ set_bool_option(opt_idx, varp, value, opt_flags)
     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, errbuf, errbuflen, opt_flags)
     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);
index cef927dbbad48125c7f8195b5b5441a688c5fcd6..fe17b71ff461a93b8576711c44379b20a230dd1e 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    787,
 /**/
     786,
 /**/