From 135fe1e4389eb0cbcad74c0ee3895cc103418f45 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 2 Oct 2011 19:31:37 +0200 Subject: [PATCH] don't send PASS cmd if password is empty --- src/ClientSocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ClientSocket.c b/src/ClientSocket.c index 98fefa7..30c2efb 100644 --- a/src/ClientSocket.c +++ b/src/ClientSocket.c @@ -33,7 +33,7 @@ struct ClientSocket* create_socket(char *host, int port, char *pass, struct User } client->host = strdup(host); client->port = port; - printf("Connect: %s:%d", client->host, client->port); + printf("Connect: %s:%d\n", client->host, client->port); client->pass = (pass == NULL ? NULL : strdup(pass)); client->user = user; client->flags = 0; @@ -87,7 +87,7 @@ int connect_socket(struct ClientSocket *client) { char sendBuf[512]; int len; - if(client->pass) { + if(client->pass && strcmp(client->pass, "")) { len = sprintf(sendBuf, "PASS :%s\n", client->pass); write_socket(client, sendBuf, len); } -- 2.20.1