]> jfr.im git - solanum.git/blobdiff - ircd/parse.c
ircd: parse: now this type cast for POINTER MATH is just fucking stupid
[solanum.git] / ircd / parse.c
index b1e57bffe2ebe7e01fe292eb4261d4492cbf1a40..92791bf31c9bf68f20039159f98cdee2a5eeccd7 100644 (file)
@@ -146,6 +146,15 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                                struct alias_entry *aptr = rb_dictionary_retrieve(alias_dict, msgbuf.cmd);
                                if (aptr != NULL)
                                {
+                                       if (msgbuf.n_para < 2)
+                                       {
+                                               sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
+                                                          me.name,
+                                                          EmptyString(client_p->name) ? "*" : client_p->name,
+                                                          msgbuf.cmd);
+                                               return;
+                                       }
+
                                        do_alias(aptr, client_p, reconstruct_parv(msgbuf.n_para - 1, msgbuf.para + 1));
                                        return;
                                }
@@ -177,7 +186,7 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
                        /* Its expected this nasty code can be removed
                         * or rewritten later if still needed.
                         */
-                       if((unsigned long) (p + 8) > (unsigned long) end)
+                       if((p + 8) > end)
                        {
                                for (; p <= end; p++)
                                {