[tlbuild] autosp.c compile fixes with -Werror...

Norbert Preining preining at logic.at
Mon Mar 12 06:45:25 CET 2018


Hi

it seems that autosp.c needs a bit of fix up. Compiling with all kind of
warnings as errors turned on I needed to apply the following fix:
--- texlive-bin-2018.20180312.46927.orig/utils/autosp/autosp-src/autosp.c
+++ texlive-bin-2018.20180312.46927/utils/autosp/autosp-src/autosp.c
@@ -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);

The fgets one is for a warning that the return value of fgets is not
used.

What should we do with these kind of things?

Best

Norbert

--
PREINING Norbert                               http://www.preining.info
Accelia Inc.     +    JAIST     +    TeX Live     +    Debian Developer
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13


More information about the tlbuild mailing list