summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-30 10:09:33 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-30 10:09:33 +0000
commite4977c19af306056bb5ecf8f7d8eabba8a0a6ef7 (patch)
tree1a4089254d5c4435f549711fdedb76869ec90fa5 /Build
parent976a0eabadfa4c8e9599ae3b37442eac22d12b63 (diff)
luaTeX: Avoid using asprintf()
git-svn-id: svn://tug.org/texlive/trunk@27246 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/utils/utils.w14
1 files changed, 12 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/luatexdir/utils/utils.w b/Build/source/texk/web2c/luatexdir/utils/utils.w
index 8889ce42e63..d7f684c300c 100644
--- a/Build/source/texk/web2c/luatexdir/utils/utils.w
+++ b/Build/source/texk/web2c/luatexdir/utils/utils.w
@@ -338,10 +338,20 @@ char *stripzeros(char *a)
@ @c
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 poppler version %s\n",
+ "Compiled with poppler version %s\n";
+ size_t len = strlen(fmt)
+ + strlen(PNG_LIBPNG_VER_STRING) + strlen(png_libpng_ver)
+ + strlen(ZLIB_VERSION) + strlen(zlib_version)
+ + strlen(POPPLER_VERSION)
+ + 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, POPPLER_VERSION);
}