From d4257c2dbcf3bf47aec575d24c41545416aba086 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Mon, 20 Mar 2017 13:35:04 +1000 Subject: [PATCH] Guess what? Another fix! --- utils/magichat/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/magichat/main.c b/utils/magichat/main.c index cf5049c..1d84604 100644 --- a/utils/magichat/main.c +++ b/utils/magichat/main.c @@ -200,7 +200,7 @@ int main(int argc, char **argv) { for(k = 0; k < client_count; k++) { if (i != clients[k]->fd && strcmp(clients[k]->nick, "UNKNOWN") != 0) { snprintf(buffer, 1024, "{\"bbs\": \"SYSTEM\", \"nick\": \"SYSTEM\", \"msg\": \"%s (%s) has joined the chat\" }", clients[j]->nick, clients[j]->bbstag); - if (send(k, buffer, strlen(buffer) + 1, 0) == -1) { + if (send(clients[k]->fd, buffer, strlen(buffer) + 1, 0) == -1) { perror("send"); } } @@ -215,7 +215,7 @@ int main(int argc, char **argv) { for(k = 0; k < client_count; k++) { if (i != clients[k]->fd && strcmp(clients[k]->nick, "UNKNOWN") != 0) { - if (send(k, buf, nbytes, 0) == -1) { + if (send(clients[k]->fd, buf, nbytes, 0) == -1) { perror("send"); } }