1
0
forked from aniani/vim

patch 7.4.1819

Problem:    Compiler warnings when sprintf() is a macro.
Solution:   Don't interrupt sprintf() with an #ifdef. (Michael Jarvis,
            closes #788)
This commit is contained in:
Bram Moolenaar
2016-05-05 18:14:03 +02:00
parent 89c79b9932
commit 827b165b2a
4 changed files with 20 additions and 16 deletions

View File

@@ -2630,12 +2630,12 @@ term_color(char_u *s, int n)
|| STRCMP(s + i + 1, "%dm") == 0)
&& (s[i] == '3' || s[i] == '4'))
{
sprintf(buf,
#ifdef TERMINFO
"%s%s%%p1%%dm",
char *format = "%s%s%%p1%%dm";
#else
"%s%s%%dm",
char *format = "%s%s%%dm";
#endif
sprintf(buf, format,
i == 2 ? IF_EB("\033[", ESC_STR "[") : "\233",
s[i] == '3' ? (n >= 16 ? "38;5;" : "9")
: (n >= 16 ? "48;5;" : "10"));