[Mesa-dev] [PATCH] gallium/hud: add a path separator between dump directory and filename

Marek Olšák maraeo at gmail.com
Tue Jan 3 21:10:01 UTC 2017


Pushed, thanks.

Marek

On Sun, Jan 1, 2017 at 10:31 PM, Edmondo Tommasina
<edmondo.tommasina at gmail.com> wrote:
> It's more user friendly and it avoids to write files in unexpected
> places.
> ---
>  src/gallium/auxiliary/hud/hud_context.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
> index 779c116..cccdb26 100644
> --- a/src/gallium/auxiliary/hud/hud_context.c
> +++ b/src/gallium/auxiliary/hud/hud_context.c
> @@ -872,9 +872,10 @@ hud_graph_set_dump_file(struct hud_graph *gr)
>     char *dump_file;
>
>     if (hud_dump_dir && access(hud_dump_dir, W_OK) == 0) {
> -      dump_file = malloc(strlen(hud_dump_dir) + sizeof(gr->name));
> +      dump_file = malloc(strlen(hud_dump_dir) + sizeof("/") + sizeof(gr->name));
>        if (dump_file) {
>           strcpy(dump_file, hud_dump_dir);
> +         strcat(dump_file, "/");
>           strcat(dump_file, gr->name);
>           gr->fd = fopen(dump_file, "w+");
>           free(dump_file);
> --
> 2.10.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list