From 49d61a93dfa6c7a7a6742403ebc5300fda2b923b Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 30 Sep 2017 10:03:16 +1000 Subject: [PATCH] Fix address resolution in chat system --- src/chat_system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat_system.c b/src/chat_system.c index d0504c7..1daa9db 100644 --- a/src/chat_system.c +++ b/src/chat_system.c @@ -176,7 +176,7 @@ void chat_system(struct user_record *user) { if ( (chat_socket = socket(AF_INET, SOCK_STREAM, 0)) < 0) { return; } - if (inet_pton(AF_INET, conf.mgchat_server, &servaddr.sin_addr) != 0) { + if (inet_pton(AF_INET, conf.mgchat_server, &servaddr.sin_addr) != 1) { hostname_to_ip(conf.mgchat_server, buffer); if (!inet_pton(AF_INET, buffer, &servaddr.sin_addr)) { return;