diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2018-12-15 10:10:23 +0100 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2018-12-15 10:10:23 +0100 |
commit | 71293f70f4e3180ea0659eb41a2fa5b1bd185205 (patch) | |
tree | a2daed87bf96b10bc2f09670d4c06a90bbabedbd | |
parent | 73fb49f4323a817ef00a88bb33b9c565720556ca (diff) | |
download | lua-compat-5.3-71293f70f4e3180ea0659eb41a2fa5b1bd185205.tar.gz lua-compat-5.3-71293f70f4e3180ea0659eb41a2fa5b1bd185205.tar.bz2 lua-compat-5.3-71293f70f4e3180ea0659eb41a2fa5b1bd185205.zip |
Fix structure initialization in compat53 lua_load
Closes #45.
-rw-r--r-- | c-api/compat-5.3.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { | |||
448 | 448 | ||
449 | COMPAT53_API int lua_load (lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) { | 449 | COMPAT53_API int lua_load (lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) { |
450 | int status = LUA_OK; | 450 | int status = LUA_OK; |
451 | compat53_reader_data compat53_data = { reader, data, 1, 0, 0 }; | 451 | compat53_reader_data compat53_data = { 0, NULL, 1, 0, 0 }; |
452 | compat53_data.reader = reader; | ||
453 | compat53_data.ud = data; | ||
452 | compat53_data.peeked_data = reader(L, data, &(compat53_data.peeked_data_size)); | 454 | compat53_data.peeked_data = reader(L, data, &(compat53_data.peeked_data_size)); |
453 | if (compat53_data.peeked_data && compat53_data.peeked_data_size && | 455 | if (compat53_data.peeked_data && compat53_data.peeked_data_size && |
454 | compat53_data.peeked_data[0] == LUA_SIGNATURE[0]) /* binary file? */ | 456 | compat53_data.peeked_data[0] == LUA_SIGNATURE[0]) /* binary file? */ |