Push empty string instead of null if len == 0 in lua_pushlstring

This commit is contained in:
indev authored and Alug committed 2025-11-06 18:48:06 +01:00
1 parent fd9ce29e6e
commit 08ca1184b7
1 file changed
+1 -1
+1 -1
View File
@@ -434,7 +434,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
lua_lock(L);
luaC_checkGC(L);
setsvalue2s(L, L->top, luaS_newlstr(L, s, len));
setsvalue2s(L, L->top, (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len));
api_incr_top(L);
lua_unlock(L);
}