summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-30 10:03:42 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-30 10:03:42 +0000
commiteb80ce0b494df66ea8b34b0c641714827fcd945e (patch)
treee25a06c82593036d4ceb0c92773d3484fcdf8367 /Build
parentf3139e44a683168fc8a8a28b71158504367ea3f4 (diff)
pdfTeX: Avoid using asprintf()
git-svn-id: svn://tug.org/texlive/trunk@27244 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/pdftexdir/utils.c14
2 files changed, 16 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index c60649ad239..6fe2bd253c0 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,7 @@
+2012-07-28 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * utils.c (initversionstring): Avoid using asprintf().
+
2012-07-19 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/pdftex.am: Distribute pdftex_version.h.
diff --git a/Build/source/texk/web2c/pdftexdir/utils.c b/Build/source/texk/web2c/pdftexdir/utils.c
index f77d2b5a974..4511ffdde9b 100644
--- a/Build/source/texk/web2c/pdftexdir/utils.c
+++ b/Build/source/texk/web2c/pdftexdir/utils.c
@@ -1271,10 +1271,20 @@ char *stripzeros(char *a)
void initversionstring(char **versions)
{
- (void) asprintf(versions,
+ const_string fmt =
"Compiled with libpng %s; using libpng %s\n"
"Compiled with zlib %s; using zlib %s\n"
- "Compiled with %s version %s\n",
+ "Compiled with %s version %s\n";
+ size_t len = strlen(fmt)
+ + strlen(PNG_LIBPNG_VER_STRING) + strlen(png_libpng_ver)
+ + strlen(ZLIB_VERSION) + strlen(zlib_version)
+ + strlen(xpdfString) + strlen(xpdfVersion)
+ + 1;
+
+ /* len will be more than enough, because of the placeholder chars in fmt
+ that get replaced by the arguments. */
+ *versions = xmalloc(len);
+ sprintf(*versions, fmt,
PNG_LIBPNG_VER_STRING, png_libpng_ver,
ZLIB_VERSION, zlib_version, xpdfString, xpdfVersion);
}