1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-25 03:23:01 +01:00

Remove unnecessary define for keeping track of string array size

This commit is contained in:
jfreegman 2021-12-15 13:39:11 -05:00
parent f91d10c831
commit b6f892edf5
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -117,15 +117,8 @@ static struct cmd_func conference_commands[] = {
{ NULL, NULL }, { NULL, NULL },
}; };
#ifdef PYTHON
#define SPECIAL_COMMANDS 8
#else
#define SPECIAL_COMMANDS 7
#endif /* PYTHON */
/* Special commands are commands that only take one argument even if it contains spaces */ /* Special commands are commands that only take one argument even if it contains spaces */
static const char special_commands[SPECIAL_COMMANDS][MAX_CMDNAME_SIZE] = { static const char special_commands[][MAX_CMDNAME_SIZE] = {
"/add", "/add",
"/avatar", "/avatar",
"/nick", "/nick",
@ -136,6 +129,7 @@ static const char special_commands[SPECIAL_COMMANDS][MAX_CMDNAME_SIZE] = {
"/sendfile", "/sendfile",
"/title", "/title",
"/mute", "/mute",
"",
}; };
/* Returns true if input command is in the special_commands array. */ /* Returns true if input command is in the special_commands array. */
@ -143,7 +137,7 @@ static bool is_special_command(const char *input)
{ {
const int s = char_find(0, input, ' '); const int s = char_find(0, input, ' ');
for (int i = 0; i < SPECIAL_COMMANDS; ++i) { for (int i = 0; special_commands[i][0] != '\0'; ++i) {
if (strncmp(input, special_commands[i], s) == 0) { if (strncmp(input, special_commands[i], s) == 0) {
return true; return true;
} }