On January 19, 2019 11:40:41 PM UTC, Caio Marcelo de Oliveira Filho 
<caio.olive...@intel.com> wrote:
> One extra character is leaking from the text into the copied line.
> The "+ 1" is an artifact from when malloc was used, strndup will add
> the extra '\0' after copying text_size bytes (if available).

Yeah, I had that change locally, but didn't push it :]

Reviewed-by: Eric Engestrom <e...@engestrom.ch>

> 
> 7c8ee3f0f "util: simplify string duplication logic"

"Fixes:" ?

> ---
>  tests/util/piglit-shader-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/util/piglit-shader-test.c
> b/tests/util/piglit-shader-test.c
> index 39df2948d..35ed3a81e 100644
> --- a/tests/util/piglit-shader-test.c
> +++ b/tests/util/piglit-shader-test.c
> @@ -140,7 +140,7 @@ piglit_load_source_from_shader_test(const char
> *filename,
>               return false;
>       }
>  
> -     text_size = line - first_line + 1;
> +     text_size = line - first_line;
>  
>       if (output_source)
>               *output_source = strndup(first_line, text_size);
> -- 
> 2.20.0
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to