summaryrefslogtreecommitdiff
path: root/Build/source/texk/ttfdump
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-03-17 12:10:35 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-03-17 12:10:35 +0000
commitbeba2700adbd1ef654015569b2b8724caf06a7f3 (patch)
tree8af85f648ba7494bb852542ca97b5854a9e40f02 /Build/source/texk/ttfdump
parent2c986f639a8f86eb48df7aeef0868b7648646d1a (diff)
texk/ttfdump: Build fix: Avoid printf("%s",NULL)
git-svn-id: svn://tug.org/texlive/trunk@36546 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump')
-rw-r--r--Build/source/texk/ttfdump/ChangeLog5
-rw-r--r--Build/source/texk/ttfdump/include/ttc.h1
-rw-r--r--Build/source/texk/ttfdump/libttf/ttc.c10
-rw-r--r--Build/source/texk/ttfdump/tests/ttfdump.gasp2
-rw-r--r--Build/source/texk/ttfdump/tests/ttfdump.maxp2
5 files changed, 14 insertions, 6 deletions
diff --git a/Build/source/texk/ttfdump/ChangeLog b/Build/source/texk/ttfdump/ChangeLog
index 95b5fb53a81..16a35f7b128 100644
--- a/Build/source/texk/ttfdump/ChangeLog
+++ b/Build/source/texk/ttfdump/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-17 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * include/ttc.h, libttf/ttc.c: Avoid segfault (NULL filename).
+ * tests/ttfdump.gasp, tests/ttfdump.maxp: Adapt.
+
2015-02-27 Peter Breitenlohner <peb@mppmu.mpg.de>
* ac/withenable.ac: Require kpathsea.
diff --git a/Build/source/texk/ttfdump/include/ttc.h b/Build/source/texk/ttfdump/include/ttc.h
index 7350114cec5..1dfce3a113c 100644
--- a/Build/source/texk/ttfdump/include/ttc.h
+++ b/Build/source/texk/ttfdump/include/ttc.h
@@ -16,7 +16,6 @@ typedef struct
TTCHeader, *TTCHeaderPtr;
TTCHeaderPtr ttfLoadTTCHeader(char *filename);
-void ttfLoadTTCFont(TTCHeaderPtr ttc, FILE *fp);
void ttfFreeTTCFont(TTCHeaderPtr ttc);
#endif /* __TTF_TTC_H */
diff --git a/Build/source/texk/ttfdump/libttf/ttc.c b/Build/source/texk/ttfdump/libttf/ttc.c
index e4625e540bc..09295af270f 100644
--- a/Build/source/texk/ttfdump/libttf/ttc.c
+++ b/Build/source/texk/ttfdump/libttf/ttc.c
@@ -15,6 +15,8 @@
/* $Id: ttc.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $ */
+static void ttfLoadTTCFont(TTCHeaderPtr ttc, FILE *fp, const char *filename);
+
TTCHeaderPtr ttfLoadTTCHeader(char * filename)
{
ULONG tag = FT_MAKE_TAG ('t', 't', 'c', 'f');
@@ -34,7 +36,7 @@ TTCHeaderPtr ttfLoadTTCHeader(char * filename)
ttc->version = ttfGetFixed(fp);
ttc->DirCount = (USHORT) ttfGetULONG(fp);
ttc->offset = ttfMakeULONG (ttc->DirCount, fp);
- ttfLoadTTCFont(ttc,fp);
+ ttfLoadTTCFont(ttc,fp,filename);
return ttc;
}
else
@@ -42,9 +44,9 @@ TTCHeaderPtr ttfLoadTTCHeader(char * filename)
return NULL;
}
-void ttfLoadTTCFont(TTCHeaderPtr ttc,FILE *fp)
+static void ttfLoadTTCFont(TTCHeaderPtr ttc,FILE *fp,const char *filename)
{
- int i;
+ unsigned int i;
ttc->font = XCALLOC (ttc->DirCount, TTFont);
@@ -53,6 +55,8 @@ void ttfLoadTTCFont(TTCHeaderPtr ttc,FILE *fp)
for (i=0;i<ttc->DirCount;i++)
{
(ttc->font+i) -> fp = fp;
+ (ttc->font+i) -> ttfname = XTALLOC (strlen(filename)+16, char);
+ sprintf ((ttc->font+i)->ttfname, "%s:%u", filename, i);
ttfLoadFont((ttc->font+i),(ttc->offset)[i]);
}
}
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.gasp b/Build/source/texk/ttfdump/tests/ttfdump.gasp
index 50b64fcc171..b331a08cd82 100644
--- a/Build/source/texk/ttfdump/tests/ttfdump.gasp
+++ b/Build/source/texk/ttfdump/tests/ttfdump.gasp
@@ -1,6 +1,6 @@
True Type Font File Dumper: v 0.5.5
Copyright 1996-1998 ollie@ms1.hinet.net
-Dumping File:(null)
+Dumping File:test.ttc:0
TrueType Collection Header
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.maxp b/Build/source/texk/ttfdump/tests/ttfdump.maxp
index 009784e55df..5e906da1739 100644
--- a/Build/source/texk/ttfdump/tests/ttfdump.maxp
+++ b/Build/source/texk/ttfdump/tests/ttfdump.maxp
@@ -1,6 +1,6 @@
True Type Font File Dumper: v 0.5.5
Copyright 1996-1998 ollie@ms1.hinet.net
-Dumping File:(null)
+Dumping File:test.ttc:1
TrueType Collection Header