]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-encoding.c
Rework check for number of parameters
[ngircd-alex.git] / src / ngircd / irc-encoding.c
index b1d3a697ca0b55c0e3f9bc858fe5b0c3c534d8a1..97b518a063b7adbf124d3760faabaa6fc840c712 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -48,15 +48,11 @@ IRC_CHARCONV(CLIENT *Client, REQUEST *Req)
        assert (Client != NULL);
        assert (Req != NULL);
 
-       if (Req->argc != 1)
-               return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
-                                         Client_ID(Client), Req->command);
-
        strlcpy(encoding, Req->argv[0], sizeof(encoding));
        ngt_UpperStr(encoding);
 
        if (!Conn_SetEncoding(Client_Conn(Client), encoding))
-               return IRC_WriteStrClient(Client, ERR_IP_CHARCONV_MSG,
+               return IRC_WriteErrClient(Client, ERR_IP_CHARCONV_MSG,
                                          Client_ID(Client), encoding);
 
        return IRC_WriteStrClient(Client, RPL_IP_CHARCONV_MSG,