mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d-common: Terminate string with '\0' unconditionally in vkd3d_debug_sprintf().
This commit is contained in:
parent
feb5e8259c
commit
f7e738c27a
@ -92,14 +92,12 @@ const char *vkd3d_dbg_sprintf(const char *fmt, ...)
|
||||
{
|
||||
char *buffer;
|
||||
va_list args;
|
||||
int size;
|
||||
|
||||
buffer = get_buffer();
|
||||
va_start(args, fmt);
|
||||
size = vsnprintf(buffer, VKD3D_DEBUG_BUFFER_SIZE, fmt, args);
|
||||
vsnprintf(buffer, VKD3D_DEBUG_BUFFER_SIZE, fmt, args);
|
||||
va_end(args);
|
||||
if (size == -1 || size >= VKD3D_DEBUG_BUFFER_SIZE)
|
||||
buffer[VKD3D_DEBUG_BUFFER_SIZE - 1] = '\0';
|
||||
buffer[VKD3D_DEBUG_BUFFER_SIZE - 1] = '\0';
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user