diff options
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/utils.c | 14 |
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); } |