Skip to content

Commit 3cae115

Browse files
tectonic: avoid assigning const value to non const variable
-Wdiscarded-qualifiers
1 parent 3876e2b commit 3cae115

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tectonic/core-bridge.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
*/
55

66
#include <tectonic/core-bridge.h>
7+
#include <tectonic/internals.h>
78

89
#include <stdio.h> /*vsnprintf*/
910
#include <stdarg.h>
11+
#include <stdlib.h>
1012
#include <setjmp.h>
1113

1214

@@ -69,7 +71,7 @@ dvipdfmx_simple_main(tt_bridge_api_t *api, char *dviname, char *pdfname)
6971
{
7072
extern int dvipdfmx_main(int argc, char *argv[]);
7173

72-
char *argv[] = { "dvipdfmx", "-o", pdfname, dviname };
74+
char *argv[] = { xstrdup("dvipdfmx"), xstrdup("-o"), pdfname, dviname };
7375
int rv;
7476

7577
tectonic_global_bridge = api;
@@ -81,6 +83,10 @@ dvipdfmx_simple_main(tt_bridge_api_t *api, char *dviname, char *pdfname)
8183

8284
rv = dvipdfmx_main(4, argv);
8385
tectonic_global_bridge = NULL;
86+
87+
free(argv[0]);
88+
free(argv[1]);
89+
8490
return rv;
8591
}
8692

tectonic/xetexini.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3736,7 +3736,7 @@ tt_run_engine(char *dump_name, char *input_file_name)
37363736
/* Make this something invariant so that we can use XDV files to test
37373737
* reproducibility of the engine output. */
37383738

3739-
output_comment = "tectonic";
3739+
output_comment = xstrdup("tectonic");
37403740

37413741
/* These various parameters were configurable in web2c TeX. We don't
37423742
* bother to allow that. */
@@ -4192,5 +4192,6 @@ tt_run_engine(char *dump_name, char *input_file_name)
41924192
final_cleanup();
41934193
close_files_and_terminate();
41944194
pdf_files_close();
4195+
free(output_comment);
41954196
return history;
41964197
}

0 commit comments

Comments
 (0)