vim_vsnprintf: fix conversion warning #6333

Re-apply fix from #6311 which was accidentally regressed in #6231.
This commit is contained in:
John Szakmeister 2017-03-22 03:49:45 -04:00 committed by Justin M. Keyes
parent 7cc4e782a0
commit 56e400d800

View File

@ -1255,7 +1255,9 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
l += (size_t)snprintf(format + l, sizeof(format) - l, ".%d",
(int)precision);
}
format[l] = fmt_spec == 'F' ? 'f' : fmt_spec;
// Cast to char to avoid a conversion warning on Ubuntu 12.04.
format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec);
format[l + 1] = NUL;
// Regular float number