Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions plugins/experimental/ts_lua/ts_lua_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,21 @@ static int
ts_lua_debug(lua_State *L)
{
const char *msg;
size_t len = 0;

msg = luaL_checkstring(L, 1);
TSDebug(TS_LUA_DEBUG_TAG, msg, NULL);
msg = luaL_checklstring(L, 1, &len);
TSDebug(TS_LUA_DEBUG_TAG, "%.*s", (int)len, msg);
return 0;
}

static int
ts_lua_error(lua_State *L)
{
const char *msg;
size_t len = 0;

msg = luaL_checkstring(L, 1);
TSError(msg, NULL);
msg = luaL_checklstring(L, 1, &len);
TSError("%.*s", (int) len, msg);
return 0;
}

Expand Down