comparison src/evalfunc.c @ 11653:67cf0d45b006 v8.0.0709

patch 8.0.0709: libvterm cannot use vsnprintf() commit https://github.com/vim/vim/commit/8327d1df1754b33d8a93b3411f30692f0042f4ce Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 11 22:34:51 2017 +0200 patch 8.0.0709: libvterm cannot use vsnprintf() Problem: Libvterm cannot use vsnprintf(), it does not exist in C90. Solution: Use vim_vsnprintf() instead.
author Christian Brabandt <cb@256bit.org>
date Tue, 11 Jul 2017 22:45:03 +0200
parents b8299e742f41
children 3b2afa2b77b3
comparison
equal deleted inserted replaced
11652:8263fcf185e3 11653:67cf0d45b006
8041 rettv->vval.v_string = NULL; 8041 rettv->vval.v_string = NULL;
8042 8042
8043 /* Get the required length, allocate the buffer and do it for real. */ 8043 /* Get the required length, allocate the buffer and do it for real. */
8044 did_emsg = FALSE; 8044 did_emsg = FALSE;
8045 fmt = (char *)get_tv_string_buf(&argvars[0], buf); 8045 fmt = (char *)get_tv_string_buf(&argvars[0], buf);
8046 len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1); 8046 len = vim_vsnprintf_typval(NULL, 0, fmt, ap, argvars + 1);
8047 if (!did_emsg) 8047 if (!did_emsg)
8048 { 8048 {
8049 s = alloc(len + 1); 8049 s = alloc(len + 1);
8050 if (s != NULL) 8050 if (s != NULL)
8051 { 8051 {
8052 rettv->vval.v_string = s; 8052 rettv->vval.v_string = s;
8053 (void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1); 8053 (void)vim_vsnprintf_typval((char *)s, len + 1, fmt,
8054 ap, argvars + 1);
8054 } 8055 }
8055 } 8056 }
8056 did_emsg |= saved_did_emsg; 8057 did_emsg |= saved_did_emsg;
8057 } 8058 }
8058 8059