texlive[42695] Build/source/texk/dvipsk: dvipsk: better fix of a bug

commits+kakuto at tug.org commits+kakuto at tug.org
Tue Dec 13 13:16:40 CET 2016


Revision: 42695
          http://tug.org/svn/texlive?view=revision&revision=42695
Author:   kakuto
Date:     2016-12-13 13:16:40 +0100 (Tue, 13 Dec 2016)
Log Message:
-----------
dvipsk: better fix of a bug reported by Norbert Klingen

Modified Paths:
--------------
    trunk/Build/source/texk/dvipsk/ChangeLog
    trunk/Build/source/texk/dvipsk/emspecial.c

Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog	2016-12-13 05:33:14 UTC (rev 42694)
+++ trunk/Build/source/texk/dvipsk/ChangeLog	2016-12-13 12:16:40 UTC (rev 42695)
@@ -1,7 +1,6 @@
 2016-12-13  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
-	* emspecial.c: Initialize emstr[500] in emspecial(), to fix wrong
-	strlen (emstr). Reported by Norbert Klingen:
+	* emspecial.c: Fix a bug in emspecial(), reported by Norbert Klingen:
 	http://tug.org/pipermail/tex-live/2016-December/039483.html.
 
 2016-11-08  Karl Berry  <karl at freefriends.org>

Modified: trunk/Build/source/texk/dvipsk/emspecial.c
===================================================================
--- trunk/Build/source/texk/dvipsk/emspecial.c	2016-12-13 05:33:14 UTC (rev 42694)
+++ trunk/Build/source/texk/dvipsk/emspecial.c	2016-12-13 12:16:40 UTC (rev 42695)
@@ -145,21 +145,6 @@
 char emstr[500];
 char *emp;
 
-/* Initialize emstr[500] because emstr in the code below may not
-   be a right string, leading to wrong strlen(emstr):
-
-              if (strlen(emstr) - 2 >= sizeof(emstr)) {
-                fprintf(stderr, "em:graph: special too long, truncating\n");
-                break;
-              }
-              emstr[i++] = *emp;
-           }
-*/
-        {
-        int k;
-        for (k = 0; k < 500; k++)
-            emstr[k] = '\0';
-        }
         hvpos();
 	for (emp = p+3; *emp && isspace((unsigned char)*emp); emp++); /* skip blanks */
 	if (strncmp(emp, "linewidth", 9) == 0) {
@@ -291,7 +276,7 @@
 	   int i;
 	   for (emp = emp+5; *emp && isspace((unsigned char)*emp); emp++); /* skip blanks */
 	   for (i=0; *emp && !isspace((unsigned char)*emp) && !(*emp==','); emp++) {
-	      if (strlen (emstr) > 498) {
+	      if (i > 498) {
                 fprintf(stderr, "em:graph: special too long, truncating\n");
                 break;
 	      }



More information about the tex-live-commits mailing list