Increase max number of words a line can be split into
This may have unintended side-effects but 32 is a very low value and I was seeing real world bugs being caused by this. Specifically an ISUPPORT line with more features than this could store.
This commit is contained in:
@ -35,6 +35,8 @@
|
||||
|
||||
#include <hexchat-plugin.h>
|
||||
|
||||
#define WORD_ARRAY_LEN 48
|
||||
|
||||
static char plugin_name[] = "Lua";
|
||||
static char plugin_description[] = "Lua scripting interface";
|
||||
static char plugin_version[16] = "1.3";
|
||||
@ -275,13 +277,13 @@ static int api_command_closure(char *word[], char *word_eol[], void *udata)
|
||||
base = lua_gettop(L);
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, info->ref);
|
||||
lua_newtable(L);
|
||||
for(i = 1; i < 32 && *word_eol[i]; i++)
|
||||
for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++)
|
||||
{
|
||||
lua_pushstring(L, word[i]);
|
||||
lua_rawseti(L, -2, i);
|
||||
}
|
||||
lua_newtable(L);
|
||||
for(i = 1; i < 32 && *word_eol[i]; i++)
|
||||
for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++)
|
||||
{
|
||||
lua_pushstring(L, word_eol[i]);
|
||||
lua_rawseti(L, -2, i);
|
||||
@ -462,13 +464,13 @@ static int api_server_closure(char *word[], char *word_eol[], void *udata)
|
||||
base = lua_gettop(L);
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, info->ref);
|
||||
lua_newtable(L);
|
||||
for(i = 1; i < 32 && *word_eol[i]; i++)
|
||||
for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++)
|
||||
{
|
||||
lua_pushstring(L, word[i]);
|
||||
lua_rawseti(L, -2, i);
|
||||
}
|
||||
lua_newtable(L);
|
||||
for(i = 1; i < 32 && *word_eol[i]; i++)
|
||||
for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++)
|
||||
{
|
||||
lua_pushstring(L, word_eol[i]);
|
||||
lua_rawseti(L, -2, i);
|
||||
@ -521,13 +523,13 @@ static int api_server_attrs_closure(char *word[], char *word_eol[], hexchat_even
|
||||
base = lua_gettop(L);
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, info->ref);
|
||||
lua_newtable(L);
|
||||
for(i = 1; i < 32 && *word_eol[i]; i++)
|
||||
for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++)
|
||||
{
|
||||
lua_pushstring(L, word[i]);
|
||||
lua_rawseti(L, -2, i);
|
||||
}
|
||||
lua_newtable(L);
|
||||
for(i = 1; i < 32 && *word_eol[i]; i++)
|
||||
for(i = 1; i < WORD_ARRAY_LEN && *word_eol[i]; i++)
|
||||
{
|
||||
lua_pushstring(L, word_eol[i]);
|
||||
lua_rawseti(L, -2, i);
|
||||
|
Reference in New Issue
Block a user