gallium/hud: add a path separator between dump directory and filename
authorEdmondo Tommasina <edmondo.tommasina@gmail.com>
Sun, 1 Jan 2017 21:31:57 +0000 (22:31 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 3 Jan 2017 21:08:41 +0000 (22:08 +0100)
It's more user friendly and it avoids to write files in unexpected
places.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/hud/hud_context.c

index f2f503dab8f2ff86281b4fbba4e03f315d408d92..44f14762a638eba56baf666b470c8e7b2d70afa3 100644 (file)
@@ -873,9 +873,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);