summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2012-12-31 19:27:32 +0100
committerAlexander Barton <alex@barton.de>2012-12-31 19:27:32 +0100
commit588af510a35b5b28cb8c1063ac865f86c65d7a8a (patch)
tree74d254d5d5cbc999bdc44003f233aeaf3bd8ab2f
parent9e1c25a889d7a18c1df7f13da64dc38e1a3a9eec (diff)
downloadngircd-588af510a35b5b28cb8c1063ac865f86c65d7a8a.tar.gz
ngircd-588af510a35b5b28cb8c1063ac865f86c65d7a8a.zip
IRC_HELP(): Code cleanup
-rw-r--r--src/ngircd/irc.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index 63c4813a..1a0d725f 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -304,25 +304,35 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
 } /* IRC_TRACE */
 
 
+/**
+ * Handler for the IRC "HELP" command.
+ *
+ * @param Client The client from which this command has been received.
+ * @param Req Request structure with prefix and all parameters.
+ * @return CONNECTED or DISCONNECTED.
+ */
 GLOBAL bool
-IRC_HELP( CLIENT *Client, REQUEST *Req )
+IRC_HELP(CLIENT *Client, REQUEST *Req)
 {
 	COMMAND *cmd;
 
-	assert( Client != NULL );
-	assert( Req != NULL );
+	assert(Client != NULL);
+	assert(Req != NULL);
 
 	/* Bad number of arguments? */
-	if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
+	if (Req->argc > 0)
+		return IRC_WriteStrClient(Client, ERR_NORECIPIENT_MSG,
+					  Client_ID(Client), Req->command);
 
-	cmd = Parse_GetCommandStruct( );
-	while( cmd->name )
-	{
-		if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
+	cmd = Parse_GetCommandStruct();
+	while(cmd->name) {
+		if (!IRC_WriteStrClient(Client, "NOTICE %s :%s",
+					Client_ID(Client), cmd->name))
+			return DISCONNECTED;
 		cmd++;
 	}
-	
-	IRC_SetPenalty( Client, 2 );
+
+	IRC_SetPenalty(Client, 2);
 	return CONNECTED;
 } /* IRC_HELP */