mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 18:16:22 +00:00
cleanup: add a defensive check in cmd_process_input()
This commit is contained in:
@@ -154,6 +154,9 @@ cmd_process_input(ProfWin* window, char* inp)
|
||||
if (inp[0] == '/') {
|
||||
auto_char char* inp_cpy = strdup(inp);
|
||||
char* command = strtok(inp_cpy, " ");
|
||||
if (!command) {
|
||||
return TRUE;
|
||||
}
|
||||
char* question_mark = strchr(command, '?');
|
||||
if (question_mark) {
|
||||
*question_mark = '\0';
|
||||
|
||||
Reference in New Issue
Block a user