Commit c2404ba3 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

msvcrt: Old versions of _vsnprintf() treat the size as a signed int.

When they see -1 they consider that the buffer is too small and return an error. So impose a 2 GB limit on sprintf() for backward compatibility with XP and 2003. Signed-off-by: 's avatarFrancois Gouget <fgouget@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7df0f4a1
......@@ -286,7 +286,7 @@ static inline int WINAPIV sprintf(char *buffer, const char *format, ...)
__ms_va_list args;
__ms_va_start(args, format);
ret = _vsnprintf(buffer, (size_t)-1, format, args);
ret = _vsnprintf(buffer, (size_t)_CRT_INT_MAX, format, args);
__ms_va_end(args);
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment