foxygit / doom Log in
commit cd65e9dae04c4473c3e979fdc6a6319cb56d2051
Author:     Turo Lamminen <turotl@gmail.com>
AuthorDate: Tue Mar 20 19:01:49 2018 +0200
Commit:     Turo Lamminen <turotl@gmail.com>
CommitDate: Tue Mar 20 19:02:49 2018 +0200

    textscreen: Fix constness issue in TXT_SelectFile
---
 textscreen/txt_fileselect.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/textscreen/txt_fileselect.c b/textscreen/txt_fileselect.c
index e88759f3..dd9232a2 100644
--- a/textscreen/txt_fileselect.c
+++ b/textscreen/txt_fileselect.c
@@ -621,8 +621,8 @@ char *TXT_SelectFile(const char *window_title, char **extensions)
     }

     argv = calloc(5 + NumExtensions(extensions), sizeof(char *));
-    argv[0] = ZENITY_BINARY;
-    argv[1] = "--file-selection";
+    argv[0] = strdup(ZENITY_BINARY);
+    argv[1] = strdup("--file-selection");
     argc = 2;

     if (window_title != NULL)
@@ -662,7 +662,7 @@ char *TXT_SelectFile(const char *window_title, char **extensions)

     result = ExecReadOutput(argv);

-    for (i = 2; i < argc; ++i)
+    for (i = 0; i < argc; ++i)
     {
         free(argv[i]);
     }