some nasty bugs
some nasty bugs

--- a/src/.vstmDB
+++ b/src/.vstmDB
@@ -4,8 +4,5 @@
 Support config file
 handle registering
 @H variables MAX_NICK_LEN and NICK_SPACE_NEEDED
-@H implement registering
-@H implement authentification
-@H when nick change, check if nick not already registered
 @L implement locking for users file
 

file:a/src/chat.c -> file:b/src/chat.c
--- a/src/chat.c
+++ b/src/chat.c
@@ -99,9 +99,8 @@
 	}
 	else {
 		sender = catch_sender(srv, buffer); /* catch the message */
-		clean_str(buffer);
-
 		if(sender > 0) { /* msg sent */
+			clean_str(buffer);
 			if(!handle_option(srv, sender, buffer))
 				send_msg(srv, buffer, sender);
 		}

--- a/src/config.c
+++ b/src/config.c
@@ -150,6 +150,8 @@
 		line++;
 	}
 
+	fclose(file);
+
 	return 1;
 } /* }}} */
 

--- a/src/connections.c
+++ b/src/connections.c
@@ -95,13 +95,13 @@
 			if(count > 0)
 				buffer[count-1] = '\0';
 
-			clean_str(buffer);
-
 			if (count <= 0)
 				return -i; /* client exit */
 
 			if ((count == 1) && buffer[0] == '\n')
 				return 0; /* some "\n" lines */
+
+			clean_str(buffer);
 
 			if (buffer[count-1] == '\n')
 				buffer[count-1] = '\0';

file:a/src/passwd -> file:b/src/passwd
--- a/src/passwd
+++ b/src/passwd
@@ -1,3 +1,4 @@
 foo	bar
 toto	blahblah
+tata	yop