texlive[50108] Build/source/texk/makejvf: support older compiler

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Feb 24 00:39:05 CET 2019


Revision: 50108
          http://tug.org/svn/texlive?view=revision&revision=50108
Author:   kakuto
Date:     2019-02-24 00:39:05 +0100 (Sun, 24 Feb 2019)
Log Message:
-----------
support older compiler

Modified Paths:
--------------
    trunk/Build/source/texk/makejvf/ChangeLog
    trunk/Build/source/texk/makejvf/main.c
    trunk/Build/source/texk/makejvf/tfmread.c

Modified: trunk/Build/source/texk/makejvf/ChangeLog
===================================================================
--- trunk/Build/source/texk/makejvf/ChangeLog	2019-02-23 23:05:02 UTC (rev 50107)
+++ trunk/Build/source/texk/makejvf/ChangeLog	2019-02-23 23:39:05 UTC (rev 50108)
@@ -1,3 +1,8 @@
+2019-02-23  Akira Kakuto  <kakuto at w32tex.org>
+
+	* main.c: Support old compiler.
+	* tfmread.c: Allocate one more byte for nbuff in tfmget().
+
 2019-02-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* main.c, tfmread.c: Forbid invalid usages.

Modified: trunk/Build/source/texk/makejvf/main.c
===================================================================
--- trunk/Build/source/texk/makejvf/main.c	2019-02-23 23:05:02 UTC (rev 50107)
+++ trunk/Build/source/texk/makejvf/main.c	2019-02-23 23:39:05 UTC (rev 50108)
@@ -20,6 +20,7 @@
 	int i,j;
 	int c;
 	long ch,ch_max;
+	const char *atfmname_base;
 
 	kpse_set_program_name(argv[0], "makejvf");
 	set_enc_string("sjis", "euc");
@@ -115,7 +116,7 @@
 		atfmname[strlen(atfmname)-4] = '\0';
 	}
 
-	const char *atfmname_base = xbasename(atfmname);
+	atfmname_base = xbasename(atfmname);
 	vfname = xmalloc(strlen(atfmname_base)+4);
 	strcpy(vfname, atfmname_base);
 	strcat(vfname,".vf");

Modified: trunk/Build/source/texk/makejvf/tfmread.c
===================================================================
--- trunk/Build/source/texk/makejvf/tfmread.c	2019-02-23 23:05:02 UTC (rev 50107)
+++ trunk/Build/source/texk/makejvf/tfmread.c	2019-02-23 23:39:05 UTC (rev 50108)
@@ -96,7 +96,7 @@
 	char *nbuff;
 	FILE *fp;
 
-	nbuff = xmalloc(strlen(name)+4);
+	nbuff = xmalloc(strlen(name)+4+1);
 	strcpy(nbuff,name);
 	strcat(nbuff,".tfm");
 	fp = fopen(nbuff,"rb");
@@ -112,6 +112,8 @@
 
 	fclose(fp);
 
+	free(nbuff);
+
 	return 0;
 }
 



More information about the tex-live-commits mailing list