diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index caba7db..35f5cf2 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -275,12 +275,14 @@ int shader_vaddline(struct wined3d_string_buffer *buffer, const char *format, va int rc; char *new_buffer; unsigned int new_buffer_size; + va_list cur_args; for (;;) { rem = buffer->buffer_size - buffer->content_size; - rc = vsnprintf(&buffer->buffer[buffer->content_size], rem, format, args); - + va_copy(cur_args, args); + rc = vsnprintf(&buffer->buffer[buffer->content_size], rem, format, cur_args); + va_end(cur_args); if (rc >= 0 /* C89 */ && (unsigned int)rc < rem /* C99 */) break;