diff options
| author | Philipp Janda <siffiejoe@gmx.net> | 2017-08-27 10:16:23 +0200 |
|---|---|---|
| committer | Philipp Janda <siffiejoe@gmx.net> | 2017-08-27 10:16:23 +0200 |
| commit | 67aabb83a1eeea860b1a9a2104c90b80a523268a (patch) | |
| tree | d11498b47e25ebf2b0c9ffddd5f7c25bedc097a1 /c-api | |
| parent | 3931e7fc37c5c3cc30f8e35e5bdb06a59af1e884 (diff) | |
| download | lua-compat-5.3-67aabb83a1eeea860b1a9a2104c90b80a523268a.tar.gz lua-compat-5.3-67aabb83a1eeea860b1a9a2104c90b80a523268a.tar.bz2 lua-compat-5.3-67aabb83a1eeea860b1a9a2104c90b80a523268a.zip | |
Handle edge case for lua_pushlstring(). Add test.
Diffstat (limited to 'c-api')
| -rw-r--r-- | c-api/compat-5.3.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index 5c3052b..7dd77c6 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h | |||
| @@ -123,7 +123,7 @@ COMPAT53_API void lua_len (lua_State *L, int i); | |||
| 123 | (lua_pushstring(L, (s)), lua_tostring(L, -1)) | 123 | (lua_pushstring(L, (s)), lua_tostring(L, -1)) |
| 124 | 124 | ||
| 125 | #define lua_pushlstring(L, s, len) \ | 125 | #define lua_pushlstring(L, s, len) \ |
| 126 | (lua_pushlstring(L, (s), (len)), lua_tostring(L, -1)) | 126 | ((((len) == 0) ? lua_pushlstring(L, "", 0) : lua_pushlstring(L, (s), (len))), lua_tostring(L, -1)) |
| 127 | 127 | ||
| 128 | #ifndef luaL_newlibtable | 128 | #ifndef luaL_newlibtable |
| 129 | # define luaL_newlibtable(L, l) \ | 129 | # define luaL_newlibtable(L, l) \ |
