From e33b6bbb65e34b1687f7a09ca21b33ab2d0d0e22 Mon Sep 17 00:00:00 2001
From: Luigi Scarso <luigi.scarso@gmail.com>
Date: Sat, 23 Mar 2019 23:39:40 +0000
Subject: [PATCH] sync with experimental rev. 7127.

---
 source/texk/web2c/luatexdir/lua/lnewtokenlib.c  | 2 +-
 source/texk/web2c/luatexdir/lua/lpdfelib.c      | 2 +-
 source/texk/web2c/luatexdir/luatex_svnversion.h | 2 +-
 source/texk/web2c/mplibdir/mp.w                 | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/source/texk/web2c/luatexdir/lua/lnewtokenlib.c b/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
index 09a51bd10..1c2bd8533 100644
--- a/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
+++ b/source/texk/web2c/luatexdir/lua/lnewtokenlib.c
@@ -1271,7 +1271,7 @@ static int set_char(lua_State * L)
     if (n < 2)
         return 0;
     name = lua_tolstring(L, 1, &lname);
-    if (name == null)
+    if (name == NULL)
         return 0;
     value = lua_tointeger(L, 2);
     if (value < 0)
diff --git a/source/texk/web2c/luatexdir/lua/lpdfelib.c b/source/texk/web2c/luatexdir/lua/lpdfelib.c
index 8f4f56d2d..455ed9b04 100644
--- a/source/texk/web2c/luatexdir/lua/lpdfelib.c
+++ b/source/texk/web2c/luatexdir/lua/lpdfelib.c
@@ -259,7 +259,7 @@ define_to_string(stream,    "pdfe.stream")
 static int pdfelib_tostring_reference(lua_State * L) { \
     pdfe_reference *p = check_isreference(L, 1); \
     if (p != NULL) { \
-        lua_pushfstring(L, "<pdfe.reference " "%i>", (int) p->onum); \
+        lua_pushfstring(L, "<pdfe.reference " "%d>",  p->onum); \
         return 1; \
     } \
     return 0; \
diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h
index f82ab3bb1..75bbf0254 100644
--- a/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1 +1 @@
-#define luatex_svn_revision 7124
+#define luatex_svn_revision 7127
diff --git a/source/texk/web2c/mplibdir/mp.w b/source/texk/web2c/mplibdir/mp.w
index dc3a7e1b8..682fb4e53 100644
--- a/source/texk/web2c/mplibdir/mp.w
+++ b/source/texk/web2c/mplibdir/mp.w
@@ -2948,7 +2948,7 @@ void *mp_xmalloc (MP mp, size_t nmem, size_t size) {
     mp_jump_out (mp);
   }
 #endif
-  w = malloc (nmem * size);
+  w = calloc(nmem, size); /* TODO: check an un-initialize use of w and replace calloc with malloc. */
   if (w == NULL) {
     mp_fputs ("Out of memory!\n", mp->err_out);
     mp->history = mp_system_error_stop;
-- 
GitLab