Skip to content

Commit

Permalink
fix: string.split会崩,原因是luaL_optlstring传参错误
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Jan 6, 2025
1 parent d5be055 commit 0fb6516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/src/lstrlib_exts.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int l_str_split (lua_State *L) {
}

size_t dlen = 0;
const char *delimiters = luaL_optlstring(L, 2, &dlen, ",");
const char *delimiters = luaL_optlstring(L, 2, ",", &dlen);
if (dlen < 1) {
delimiters = ",";
dlen = 1;
Expand Down

0 comments on commit 0fb6516

Please sign in to comment.