login seems to work
login seems to work

--- a/src/extra_options.c
+++ b/src/extra_options.c
@@ -140,11 +140,19 @@
 
 	char message_nocolor[MAX_MSG_SNT_LEN];
 
+	if(args == NULL || strlen(args) < 2) {
+		send_msg_to_client(srv, TNCMSG_OPT_LOGIN_USAGE"\n", asker);
+		puts("Foo");
+		return;
+	}
+	puts("FUU");
+	printf(">>%s<<", args);
+
 	nick = args;
 	pwd = args;
-	while(*pwd != '=' && *pwd != '\0')
+	while(*pwd != ' ' && *pwd != '\0')
 		pwd++;
-	if(*pwd== '=') {
+	if(*pwd== ' ') {
 		*pwd = '\0';
 		pwd++;
 	}
@@ -162,7 +170,7 @@
 
 		strcpy(srv->client_list[asker].nick, nick);
 
-		sprintf(message_nocolor, TNCMSG_OPT_LOGIN_CHANGED_NICK"\n",
+		sprintf(message_nocolor, TNCMSG_OPT_LOGIN_CHANGED_NICK,
 		                      client_nick, nick);
 
 		send_brdcst(srv, message_nocolor, NULL, -1);

--- a/src/messages.h
+++ b/src/messages.h
@@ -18,6 +18,7 @@
 /* LOGIN */
 #define TNCMSG_OPT_LOGIN_CHANGED_NICK "%s changed his nick to %s"
 #define TNCMSG_OPT_LOGIN_WRONG "Wrong password or nick not registered"
+#define TNCMSG_OPT_LOGIN_USAGE "Usage: /login USER PASSWORD"
 
 /**** USERS ****/
 #define TNCMSG_NICK_TAKEN_NEED_LOGIN "The nick is taken/registered. If you want to use it, type: /login nick password"

--- a/src/users_file.c
+++ b/src/users_file.c
@@ -43,7 +43,7 @@
 {
 	FILE *users_file;
 	char buffer[MAX_MSG_RCV_LEN * 2 + 10];
-	char *password;
+	char *password, *pwdbis;
 	char *pwd_hashed;
 
 	if(srv->users_file == NULL)
@@ -54,6 +54,8 @@
 			srv->users_file);
 		return 0; /* Could not be authed */
 	}
+
+	printf("OK, I have: nick: >%s< and pwd: >%s<\n", user, pwd);
 
 	while(fgets(buffer, sizeof(buffer) - 2, users_file) != NULL) {
 		if(*buffer == '\0' || *buffer == '\n')
@@ -68,11 +70,19 @@
 			password++;
 		}
 
+		pwdbis = password;
+		while(*pwdbis != '\n' && *pwdbis != '\0')
+			pwdbis++;
+		*pwdbis = '\0';
+
+		printf("I read: >%s< >%s<\n", buffer, password);
+
 		if(!strcmp(buffer, user)) {
 			/* User exists */
 			puts("User exists!");
 			pwd_hashed = hash_pwd(pwd);
 			if(!strcmp(password, pwd_hashed)) {
+				puts("and pw ok !");
 				/* Pwd OK ! */
 				free(pwd_hashed);
 				return 1;
@@ -129,11 +139,13 @@
 char *
 hash_pwd(char *pwd_to_hash)
 {
+/*
 	char *pwd;
-
 	pwd = malloc(sizeof(char*) * (strlen(pwd_to_hash) + 5));
 	strcpy(pwd, pwd_to_hash);
+*/
 	/* TODO: IMPLEMENT A TYPE OF HASH */
-	return pwd; /* TO FREE */
+
+	return strdup(pwd_to_hash); /* TO FREE */
 }