Skip to content
Snippets Groups Projects
Commit f7e738c2 authored by Józef Kucia's avatar Józef Kucia
Browse files

libs/vkd3d-common: Terminate string with '\0' unconditionally in vkd3d_debug_sprintf().

parent feb5e825
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment