Merge #8419 'Fix PVS warnings'

This commit is contained in:
Justin M. Keyes
2018-05-20 09:42:18 +02:00
committed by GitHub
3 changed files with 3 additions and 2 deletions

View File

@@ -252,7 +252,7 @@ tcp_retry:
} }
status = 1; status = 1;
LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, timeout, status != 1); LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, timeout, status != 1);
if (status == 0) { if (status == 0) { // -V547
stream_init(NULL, stream, -1, uv_stream); stream_init(NULL, stream, -1, uv_stream);
success = true; success = true;
} else if (is_tcp && addrinfo->ai_next) { } else if (is_tcp && addrinfo->ai_next) {

View File

@@ -1854,6 +1854,7 @@ static int vgetorpeek(int advance)
} }
} else if (keylen > mp_match_len } else if (keylen > mp_match_len
|| (keylen == mp_match_len || (keylen == mp_match_len
&& mp_match != NULL
&& (mp_match->m_mode & LANGMAP) == 0 && (mp_match->m_mode & LANGMAP) == 0
&& (mp->m_mode & LANGMAP) != 0)) { && (mp->m_mode & LANGMAP) != 0)) {
// found a longer match // found a longer match

View File

@@ -1253,11 +1253,11 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
} }
// Cast to char to avoid a conversion warning on Ubuntu 12.04. // Cast to char to avoid a conversion warning on Ubuntu 12.04.
assert(l + 1 < sizeof(format));
format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec); format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec);
format[l + 1] = NUL; format[l + 1] = NUL;
// Regular float number // Regular float number
assert(l + 1 < sizeof(format));
str_arg_l = (size_t)snprintf(tmp, sizeof(tmp), format, f); str_arg_l = (size_t)snprintf(tmp, sizeof(tmp), format, f);
assert(str_arg_l < sizeof(tmp)); assert(str_arg_l < sizeof(tmp));