diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-12 09:16:42 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-12 09:16:42 +0000 |
commit | 407d9343645e513de21e0d34d08786b13be06319 (patch) | |
tree | 1d0658091ad296e6930d951f1a98f920cd81ad52 /Build | |
parent | a1426dc8206be0c8eac492d0c02acdd0da3c938c (diff) |
fix a potential bug in autosp, Norbert.
git-svn-id: svn://tug.org/texlive/trunk@46930 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/utils/autosp/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/utils/autosp/TLpatches/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/utils/autosp/TLpatches/patch-01-binary-write | 29 | ||||
-rw-r--r-- | Build/source/utils/autosp/autosp-src/autosp.c | 5 |
4 files changed, 36 insertions, 7 deletions
diff --git a/Build/source/utils/autosp/ChangeLog b/Build/source/utils/autosp/ChangeLog index 37953f941a5..0b27a518bf0 100644 --- a/Build/source/utils/autosp/ChangeLog +++ b/Build/source/utils/autosp/ChangeLog @@ -1,3 +1,8 @@ +2018-03-12 Norbert Preining <norbert@preining.info> + + * autosp.c: Fix a potential bug in the usage of fprintf(). + Avoid a compiler warning. + 2018-03-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * autosp-src/tex2aspc.test: Make robust. diff --git a/Build/source/utils/autosp/TLpatches/ChangeLog b/Build/source/utils/autosp/TLpatches/ChangeLog index c95ddf7fac0..bff16809006 100644 --- a/Build/source/utils/autosp/TLpatches/ChangeLog +++ b/Build/source/utils/autosp/TLpatches/ChangeLog @@ -1,3 +1,7 @@ +2018-03-12 Norbert Preining <norbert@preining.info> + + * patch-01-binary-write: Add two changes in autosp.c. + 2018-02-23 Akira Kakuto <kakuto@fuk.kindai.ac.jp> Import autosp-2018-02-23. diff --git a/Build/source/utils/autosp/TLpatches/patch-01-binary-write b/Build/source/utils/autosp/TLpatches/patch-01-binary-write index ebe4b6c554b..ed161880d3b 100644 --- a/Build/source/utils/autosp/TLpatches/patch-01-binary-write +++ b/Build/source/utils/autosp/TLpatches/patch-01-binary-write @@ -1,6 +1,6 @@ diff -ur autosp-2018-02-23/autosp.c autosp-src/autosp.c --- autosp-2018-02-23/autosp.c Fri Feb 23 23:55:07 2018 -+++ autosp-src/autosp.c Sat Feb 24 08:07:57 2018 ++++ autosp-src/autosp.c Mon Mar 12 17:58:18 2018 @@ -510,7 +510,7 @@ update_global_skip (n); /* commas will be discarded by filter_output (i) */ @@ -28,7 +28,26 @@ diff -ur autosp-2018-02-23/autosp.c autosp-src/autosp.c t = strpbrk (s+1, "{\\&|$"); /* collective coding? */ if (*t == '{') /* {...} */ -@@ -2153,7 +2153,7 @@ +@@ -2007,7 +2007,7 @@ + || prefix ("\\end%", *ln) + || prefix ("\\end{document}", *ln) ) + { +- fprintf (outfile, *ln); ++ fprintf (outfile, "%s", *ln); + exit(0); + } + +@@ -2054,7 +2054,8 @@ + while ( c != EOF ) + { + ungetc (c, infile); +- fgets(line, LINE_LEN, infile); ++ if (fgets(line, LINE_LEN, infile) == NULL) ++ error ("Unexpected EOF."); + lineno++; + process_line (); + c = getc (infile); +@@ -2153,7 +2154,7 @@ } else { @@ -37,7 +56,7 @@ diff -ur autosp-2018-02-23/autosp.c autosp-src/autosp.c if (outfile == NULL) { printf ("Can't open %s\n", outfilename); exit (EXIT_FAILURE); -@@ -2171,7 +2171,7 @@ +@@ -2171,7 +2172,7 @@ *logfilename_n = '\0'; append (logfilename, &logfilename_n, "alog", sizeof (logfilename)); if (debug) @@ -48,7 +67,7 @@ diff -ur autosp-2018-02-23/autosp.c autosp-src/autosp.c exit (EXIT_FAILURE); diff -ur autosp-2018-02-23/rebar.c autosp-src/rebar.c --- autosp-2018-02-23/rebar.c Thu Jun 15 03:08:12 2017 -+++ autosp-src/rebar.c Sat Feb 24 08:08:27 2018 ++++ autosp-src/rebar.c Sat Feb 24 08:08:28 2018 @@ -262,7 +262,7 @@ else append (outfilename, &outfilename_n, ".aspc", sizeof (outfilename)); @@ -60,7 +79,7 @@ diff -ur autosp-2018-02-23/rebar.c autosp-src/rebar.c exit (EXIT_FAILURE); diff -ur autosp-2018-02-23/tex2aspc.c autosp-src/tex2aspc.c --- autosp-2018-02-23/tex2aspc.c Sat Dec 16 00:04:13 2017 -+++ autosp-src/tex2aspc.c Sat Feb 24 08:08:55 2018 ++++ autosp-src/tex2aspc.c Sat Feb 24 08:08:56 2018 @@ -337,7 +337,7 @@ append (outfilename, &outfilename_n, ".aspc", sizeof (outfilename)); } diff --git a/Build/source/utils/autosp/autosp-src/autosp.c b/Build/source/utils/autosp/autosp-src/autosp.c index 4e9773e85d2..65dd02546c4 100644 --- a/Build/source/utils/autosp/autosp-src/autosp.c +++ b/Build/source/utils/autosp/autosp-src/autosp.c @@ -2007,7 +2007,7 @@ void process_command (char **ln) || prefix ("\\end%", *ln) || prefix ("\\end{document}", *ln) ) { - fprintf (outfile, *ln); + fprintf (outfile, "%s", *ln); exit(0); } @@ -2054,7 +2054,8 @@ void process_score () while ( c != EOF ) { ungetc (c, infile); - fgets(line, LINE_LEN, infile); + if (fgets(line, LINE_LEN, infile) == NULL) + error ("Unexpected EOF."); lineno++; process_line (); c = getc (infile); |