]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/parse.c
Update comments for parv[0] removal.
[irc/rqf/shadowircd.git] / src / parse.c
index a2979b692d2f3cb057764154b75e1b773ef2da8c..37d0c88f0fd93145bffbb8e885b2062188aa7aec 100644 (file)
@@ -31,7 +31,7 @@
 #include "channel.h"
 #include "common.h"
 #include "hash.h"
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "logger.h"
@@ -50,7 +50,7 @@ struct Dictionary *alias_dict = NULL;
  */
 static char *sender;
 
-/* parv[0] == source, and parv[LAST] == NULL */
+/* parv[0] is not used, and parv[LAST] == NULL */
 static char *para[MAXPARA + 2];
 
 static void cancel_clients(struct Client *, struct Client *, char *);
@@ -104,7 +104,7 @@ string_to_array(char *string, char **parv)
                if(*buf == '\0')
                        return x;
        }
-       /* we can go upto parv[MAXPARA], as parv[0] is taken by source */
+       /* we can go upto parv[MAXPARA], as parv[0] is skipped */
        while (x < MAXPARA);
 
        if(*p == ':')
@@ -364,7 +364,7 @@ handle_command(struct Message *mptr, struct Client *client_p,
                ilog(L_SERVER,
                     "Insufficient parameters (%d < %d) for command '%s' from %s.",
                     i, ehandler.min_para, mptr->cmd, client_p->name);
-               snprintf(squitreason, sizeof squitreason,
+               rb_snprintf(squitreason, sizeof squitreason,
                                "Insufficient parameters (%d < %d) for command '%s'",
                                i, ehandler.min_para, mptr->cmd);
                exit_client(client_p, client_p, client_p, squitreason);
@@ -508,7 +508,7 @@ cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
                                     "Message for %s[%s] from %s",
                                     source_p->name, source_p->from->name,
-                                    get_server_name(client_p, SHOW_IP));
+                                    client_p->name);
        }
        else
        {
@@ -518,7 +518,7 @@ cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
                                     source_p->username,
                                     source_p->host,
                                     source_p->from->name,
-                                    get_server_name(client_p, SHOW_IP));
+                                    client_p->name);
        }
 }
 
@@ -533,7 +533,7 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
 {
        int slen = strlen(lsender);
 
-       /* meepfoo      is a nickname (KILL)
+       /* meepfoo      is a nickname (ignore)
         * #XXXXXXXX    is a UID (KILL)
         * #XX          is a SID (SQUIT)
         * meep.foo     is a server (SQUIT)
@@ -543,14 +543,14 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
        {
                sendto_realops_snomask(SNO_DEBUG, L_ALL,
                                     "Unknown prefix (%s) from %s, Squitting %s",
-                                    lbuffer, get_server_name(client_p, SHOW_IP), lsender);
+                                    lbuffer, client_p->name, lsender);
 
                sendto_one(client_p,
                           ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
                           get_id(&me, client_p), lsender, 
                           lbuffer, client_p->name);
        }
-       else
+       else if(IsDigit(lsender[0]))
                sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)", 
                           get_id(&me, client_p), lsender, me.name);
 }
@@ -560,7 +560,6 @@ remove_unknown(struct Client *client_p, char *lsender, char *lbuffer)
 /*
  *
  *      parc    number of arguments ('sender' counted as one!)
- *      parv[0] pointer to 'sender' (may point to empty string) (not used)
  *      parv[1]..parv[parc-1]
  *              pointers to additional parameters, this is a NULL
  *              terminated list (parv[parc] == NULL).