diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-11-25 00:12:01 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-11-25 00:12:01 +0100 |
commit | 4676f67b6f63bd7d113c126ec151396fa602f037 (patch) | |
tree | 55b512d30fbe94284ad54b1d80bc81abd3809160 /FICS/command.c | |
parent | 2feba16c8c5b0808efd1744502a36b700c931633 (diff) |
process_input: added null check
Diffstat (limited to 'FICS/command.c')
-rw-r--r-- | FICS/command.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/FICS/command.c b/FICS/command.c index d1f627e..b3f4e29 100644 --- a/FICS/command.c +++ b/FICS/command.c @@ -1089,6 +1089,9 @@ process_input(int fd, char *com_string) if (p < 0) { fprintf(stderr, "FICS: Input from a player not in array!\n"); return -1; + } else if (com_string == NULL) { + fprintf(stderr, "FICS: Command string is NULL!\n"); + return -1; } commanding_player = p; @@ -1107,7 +1110,7 @@ process_input(int fd, char *com_string) case PLAYER_LOGIN: retval = process_login(p, com_string); - if (retval == COM_LOGOUT && com_string != NULL) { + if (retval == COM_LOGOUT) { // && com_string != NULL fprintf(stderr, "%s tried to log in and failed.\n", com_string); } |