Fix address resolution in chat system

This commit is contained in:
Andrew Pamment 2017-09-30 10:03:16 +10:00
parent c17e0e68c4
commit 49d61a93df

View File

@ -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;