summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/ttf2pk/ChangeLog6
-rw-r--r--Build/source/texk/ttf2pk/newobj.c16
-rw-r--r--Build/source/texk/ttf2pk/newobj.h10
-rw-r--r--Build/source/texk/ttf2pk/tfmaux.c2
-rw-r--r--Build/source/texk/ttf2pk2/ChangeLog4
-rw-r--r--Build/source/texk/ttf2pk2/tfmaux.c2
6 files changed, 36 insertions, 4 deletions
diff --git a/Build/source/texk/ttf2pk/ChangeLog b/Build/source/texk/ttf2pk/ChangeLog
index 336c578eaa7..bbf06c4097d 100644
--- a/Build/source/texk/ttf2pk/ChangeLog
+++ b/Build/source/texk/ttf2pk/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tfmaux.c: Use mycalloc() to initialize header array (with 0).
+ * newobj.[ch]: Replace my{m,c,re}alloc() => x{m,c,re}alloc()
+ when using KPATHSEA, otherwise declare and define mycalloc().
+
2013-07-30 Peter Breitenlohner <peb@mppmu.mpg.de>
* ttf2tfm.c: Build title with progname instead of argv[0] as
diff --git a/Build/source/texk/ttf2pk/newobj.c b/Build/source/texk/ttf2pk/newobj.c
index 1c741f99e29..eede1470a9d 100644
--- a/Build/source/texk/ttf2pk/newobj.c
+++ b/Build/source/texk/ttf2pk/newobj.c
@@ -22,6 +22,7 @@
#include "texenc.h"
+#if !defined(HAVE_LIBKPATHSEA)
void *
mymalloc(size_t len)
{
@@ -46,6 +47,20 @@ mymalloc(size_t len)
void *
+mycalloc(size_t nmemb, size_t len)
+{
+ void *p;
+
+ p = calloc(nmemb ? nmemb : 1, len ? len : 1);
+
+ if (p == NULL)
+ oops("Out of memory.");
+
+ return p;
+}
+
+
+void *
myrealloc(void *oldp, size_t len)
{
void *p;
@@ -66,6 +81,7 @@ myrealloc(void *oldp, size_t len)
return p;
}
+#endif
/*
diff --git a/Build/source/texk/ttf2pk/newobj.h b/Build/source/texk/ttf2pk/newobj.h
index 52beb0737ea..7fe4c2c72c1 100644
--- a/Build/source/texk/ttf2pk/newobj.h
+++ b/Build/source/texk/ttf2pk/newobj.h
@@ -15,15 +15,21 @@
#include "ttf2tfm.h"
+#if defined(HAVE_LIBKPATHSEA)
+#include <kpathsea/config.h>
+#define mymalloc xmalloc
+#define mycalloc xcalloc
+#define myrealloc xrealloc
+#else
#if (defined(MSDOS) && defined(__TURBOC__)) || \
(defined(OS2) && defined(_MSC_VER))
#define SMALLMALLOC
#endif
-
void *mymalloc(size_t len);
-void *mycalloc(size_t len);
+void *mycalloc(size_t nmemb, size_t len);
void *myrealloc(void *oldp, size_t len);
+#endif
char *get_line(FILE *f);
Boolean texlive_getline(char **bufferp, FILE *f);
diff --git a/Build/source/texk/ttf2pk/tfmaux.c b/Build/source/texk/ttf2pk/tfmaux.c
index fb379e2b07c..d0fe18cf14a 100644
--- a/Build/source/texk/ttf2pk/tfmaux.c
+++ b/Build/source/texk/ttf2pk/tfmaux.c
@@ -367,7 +367,7 @@ buildtfm(Font *fnt)
oops("No TTF characters.");
}
- header = (long *)mymalloc(40000L);
+ header = (long *)mycalloc(40000L, sizeof(char));
fnt->cksum = checksum(fnt->inencptrs);
header[0] = fnt->cksum;
header[1] = 0xA00000; /* 10pt design size */
diff --git a/Build/source/texk/ttf2pk2/ChangeLog b/Build/source/texk/ttf2pk2/ChangeLog
index 1a3ecba0cab..65e89cd4a96 100644
--- a/Build/source/texk/ttf2pk2/ChangeLog
+++ b/Build/source/texk/ttf2pk2/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tfmaux.c: Use mycalloc() to initialize header array (with 0).
+
2013-07-18 Peter Breitenlohner <peb@mppmu.mpg.de>
* ttf2tfm.c: Build title with progname instead of argv[0] as
diff --git a/Build/source/texk/ttf2pk2/tfmaux.c b/Build/source/texk/ttf2pk2/tfmaux.c
index fb379e2b07c..d0fe18cf14a 100644
--- a/Build/source/texk/ttf2pk2/tfmaux.c
+++ b/Build/source/texk/ttf2pk2/tfmaux.c
@@ -367,7 +367,7 @@ buildtfm(Font *fnt)
oops("No TTF characters.");
}
- header = (long *)mymalloc(40000L);
+ header = (long *)mycalloc(40000L, sizeof(char));
fnt->cksum = checksum(fnt->inencptrs);
header[0] = fnt->cksum;
header[1] = 0xA00000; /* 10pt design size */