1
0
forked from aniani/vim

patch 8.0.0709: libvterm cannot use vsnprintf()

Problem:    Libvterm cannot use vsnprintf(), it does not exist in C90.
Solution:   Use vim_vsnprintf() instead.
This commit is contained in:
Bram Moolenaar
2017-07-11 22:34:51 +02:00
parent 292eff0c5a
commit 8327d1df17
7 changed files with 51 additions and 10 deletions

View File

@@ -8043,14 +8043,15 @@ f_printf(typval_T *argvars, typval_T *rettv)
/* Get the required length, allocate the buffer and do it for real. */
did_emsg = FALSE;
fmt = (char *)get_tv_string_buf(&argvars[0], buf);
len = vim_vsnprintf(NULL, 0, fmt, ap, argvars + 1);
len = vim_vsnprintf_typval(NULL, 0, fmt, ap, argvars + 1);
if (!did_emsg)
{
s = alloc(len + 1);
if (s != NULL)
{
rettv->vval.v_string = s;
(void)vim_vsnprintf((char *)s, len + 1, fmt, ap, argvars + 1);
(void)vim_vsnprintf_typval((char *)s, len + 1, fmt,
ap, argvars + 1);
}
}
did_emsg |= saved_did_emsg;