1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-15 14:06:34 +01:00

code cleanup and fix bug that sometimes prevented tab notifications from working

This commit is contained in:
Jfreegman
2014-09-04 18:23:52 -04:00
parent e823233149
commit 96b68058bb
2 changed files with 101 additions and 103 deletions

View File

@@ -59,7 +59,7 @@ static struct cmd_func global_commands[] = {
{ "/lsdev", cmd_list_devices },
{ "/sdev", cmd_change_device },
#endif /* _AUDIO */
{ NULL, NULL },
{ NULL, NULL },
};
static struct cmd_func chat_commands[] = {
@@ -77,7 +77,7 @@ static struct cmd_func chat_commands[] = {
{ "/mute", cmd_mute },
{ "/sense", cmd_sense },
#endif /* _AUDIO */
{ NULL, NULL },
{ NULL, NULL },
};
/* Parses input command and puts args into arg array.
@@ -101,7 +101,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a
i = char_find(1, cmd, '\"');
if (cmd[i] == '\0') {
char *errmsg = "Invalid argument. Did you forget a closing \"?";
const char *errmsg = "Invalid argument. Did you forget a closing \"?";
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, errmsg);
free(cmd);
return -1;
@@ -118,7 +118,7 @@ static int parse_command(WINDOW *w, ToxWindow *self, const char *input, char (*a
char tmp[MAX_STR_SIZE];
snprintf(tmp, sizeof(tmp), "%s", &cmd[i + 1]);
strcpy(cmd, tmp);
strcpy(cmd, tmp); /* tmp will always fit inside cmd */
}
free(cmd);