diff options
| author | Federico G. Schwindt <fgsch@lodoss.net> | 2013-09-05 10:46:13 +0100 |
|---|---|---|
| committer | Federico G. Schwindt <fgsch@lodoss.net> | 2013-09-05 17:31:56 +0100 |
| commit | a98bbc8e0b937f4fedf7ad852eaf109c6a9c5b8f (patch) | |
| tree | 9c630d0ea928624124d2662799a043d272b9a8a8 | |
| parent | 9f74c0ff075dc67e068b8c2da0c069b6c622e436 (diff) | |
| download | ngircd-a98bbc8e0b937f4fedf7ad852eaf109c6a9c5b8f.tar.gz ngircd-a98bbc8e0b937f4fedf7ad852eaf109c6a9c5b8f.zip | |
Correct numeric returned by whois
As per RFC whois should return 431 if no nick is provided. While here convert upper check to use irc-macros. As a bonus we get to set the penalty for free.
| -rw-r--r-- | src/ngircd/irc-info.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 3d77237f..6013fa0c 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -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 */ |