[PATCH 1/6] wined3d: Add helper function to construct debug strings.

Henri Verbeet hverbeet at gmail.com
Fri Feb 23 06:16:15 CST 2018


On 22 February 2018 at 19:13, Józef Kucia <jkucia at codeweavers.com> wrote:
> +static BOOL debug_append(struct debug_buffer *buffer, const char *str, const char *separator)
> +{
> +    int size;
> +
> +    if (!separator || buffer->ptr == buffer->str)
> +        separator = "";
> +    size = snprintf(buffer->ptr, buffer->size, "%s%s", separator, str);
> +    if (size == -1 || size >= buffer->size)
> +    {
> +        buffer->size = 0;
> +        return FALSE;
> +    }
I'm not especially concerned about it, but note that this would give
no indication that any text was omitted. It may be helpful to e.g.
replace the end of the debug string with "..." when this happens.



More information about the wine-devel mailing list