diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-30 10:07:58 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-30 10:07:58 +0000 |
commit | 976a0eabadfa4c8e9599ae3b37442eac22d12b63 (patch) | |
tree | 906f2d2f7a5d0956b0da310db757c66af691d9f9 /Build/source/texk/web2c/luatexdir/lua/luainit.w | |
parent | eb80ce0b494df66ea8b34b0c641714827fcd945e (diff) |
luaTeX: Avoid using asprintf()
git-svn-id: svn://tug.org/texlive/trunk@27245 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua/luainit.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luainit.w | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w index 876b901bd7b..b31b72a218e 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luainit.w +++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w @@ -738,9 +738,18 @@ void lua_initialize(int ac, char **av) argc = ac; argv = av; - if (asprintf(&banner, "This is LuaTeX, Version %s-%d" WEB2CVERSION, - luatex_version_string, luatex_date_info) < 0) { - exit(EXIT_FAILURE); + { + const char *fmt = "This is LuaTeX, Version %s-%s" WEB2CVERSION; + size_t len; + char buf[16]; + + sprintf(buf, "%d", luatex_date_info); + len = strlen(fmt) + strlen(luatex_version_string) + strlen(buf) - 3; + + /* len is just enough, because of the placeholder chars in fmt + that get replaced by the arguments. */ + banner = xmalloc(len); + sprintf(banner, fmt, luatex_version_string, buf); } ptexbanner = banner; |