]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc-info.c
Move the IRC_SetPenalty() call after the asserts
[ngircd.git] / src / ngircd / irc-info.c
index 47a3797974a0d8c9f511c86b32055aa30b4f60fb..ea0ed4e58e481e5503a99510341648276be9b940 100644 (file)
@@ -407,8 +407,8 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
            (from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o')))) {
                /* Client hostname */
                if (!IRC_WriteStrClient(from, RPL_WHOISHOST_MSG,
-                                       Client_ID(from), Client_ID(c), Client_Hostname(c),
-                                       Conn_GetIPAInfo(Client_Conn(c))))
+                                       Client_ID(from), Client_ID(c),
+                                       Client_Hostname(c), Client_IPAText(c)))
                        return DISCONNECTED;
                /* Client modes */
                if (!IRC_WriteStrClient(from, RPL_WHOISMODES_MSG,
@@ -718,11 +718,11 @@ IRC_SERVLIST(CLIENT *Client, REQUEST *Req)
 {
        CLIENT *c;
 
-       IRC_SetPenalty(Client, 1);
-
        assert(Client != NULL);
        assert(Req != NULL);
 
+       IRC_SetPenalty(Client, 1);
+
        _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
 
        if (Req->argc < 2 || strcmp(Req->argv[1], "0") == 0) {
@@ -1211,11 +1211,12 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
 
        IRC_SetPenalty(Client, 1);
 
-       /* Bad number of parameters? */
-       if (Req->argc < 1 || Req->argc > 2)
-               return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
-                                         Client_ID(Client), Req->command);
+       /* Wrong number of parameters? */
+       if (Req->argc < 1)
+               return IRC_WriteErrClient(Client, ERR_NONICKNAMEGIVEN_MSG,
+                                         Client_ID(Client));
 
+       _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
        _IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
 
        /* Get target server for this command */