From 71293f70f4e3180ea0659eb41a2fa5b1bd185205 Mon Sep 17 00:00:00 2001 From: Philipp Janda Date: Sat, 15 Dec 2018 10:10:23 +0100 Subject: Fix structure initialization in compat53 lua_load Closes #45. --- c-api/compat-5.3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'c-api') diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c index 590e3c8..be7f87e 100644 --- a/c-api/compat-5.3.c +++ b/c-api/compat-5.3.c @@ -448,7 +448,9 @@ static const char *compat53_reader (lua_State *L, void *ud, size_t *size) { COMPAT53_API int lua_load (lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) { int status = LUA_OK; - compat53_reader_data compat53_data = { reader, data, 1, 0, 0 }; + compat53_reader_data compat53_data = { 0, NULL, 1, 0, 0 }; + compat53_data.reader = reader; + compat53_data.ud = data; compat53_data.peeked_data = reader(L, data, &(compat53_data.peeked_data_size)); if (compat53_data.peeked_data && compat53_data.peeked_data_size && compat53_data.peeked_data[0] == LUA_SIGNATURE[0]) /* binary file? */ -- cgit v1.2.3-55-g6feb