projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b45e9cc
)
don't send PASS cmd if password is empty
author
pk910
<philipp@zoelle1.de>
Sun, 2 Oct 2011 17:31:37 +0000
(19:31 +0200)
committer
pk910
<philipp@zoelle1.de>
Sun, 2 Oct 2011 17:31:37 +0000
(19:31 +0200)
src/ClientSocket.c
patch
|
blob
|
history
diff --git
a/src/ClientSocket.c
b/src/ClientSocket.c
index 98fefa7eedf5205024d62bc16123b6d0aa9420ce..30c2efb4ec7e2d9c7cf69280fc47719720a36884 100644
(file)
--- 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;
}
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;
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;
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);
}
len = sprintf(sendBuf, "PASS :%s\n", client->pass);
write_socket(client, sendBuf, len);
}