implemented the exit_cmd macro

This commit is contained in:
Václav Šmejkal 2024-04-17 17:45:21 +02:00
parent b2ca56e927
commit b2c945fe6d
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
3 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ int main(void)
why2_send_socket(line, NULL, listen_socket); //NULL IS SENT BECAUSE IT IS USELESS TO SEND USER FROM CLIENT - SERVER WON'T USE IT
if (strcmp(line, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT
if (strcmp(line, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT "\n") == 0) //USER REQUESTED PROGRAM EXIT
{
printf("Exiting...\n");
break;

View File

@ -63,7 +63,7 @@ int main(void)
{
if (getline(&line_buffer, &line_length_buffer, stdin) == -1) why2_die("Reading input failed.");
if (strcmp(line_buffer, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT
if (strcmp(line_buffer, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT "\n") == 0) //USER REQUESTED PROGRAM EXIT
{
printf("Exiting...\n");
break;

View File

@ -655,7 +655,7 @@ void *why2_communicate_thread(void *arg)
{
if (decoded_buffer[0] == '!') //COMMANDS
{
if (strcmp(decoded_buffer, "!exit") == 0) //USER REQUESTED EXIT
if (strcmp(decoded_buffer, WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_EXIT) == 0) //USER REQUESTED EXIT
{
exiting = 1;
} else