]> jfr.im git - solanum.git/blobdiff - modules/m_services.c
gcc7 fixes: NICKLEN -> NAMELEN
[solanum.git] / modules / m_services.c
index a36c06a4624a823f17a23dc094d154bd849d2e5b..6633319d950468449a522829ee59605292bbe0ed 100644 (file)
@@ -32,8 +32,7 @@
 #include "send.h"
 #include "channel.h"
 #include "client.h"
-#include "common.h"
-#include "config.h"
+#include "defaults.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "s_conf.h"
@@ -55,10 +54,10 @@ static void _moddeinit(void);
 static void mark_services(void);
 static void unmark_services(void);
 
-static int me_su(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_login(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_rsfnc(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_nickdelay(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_su(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_login(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_rsfnc(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_nickdelay(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 static void h_svc_server_introduced(hook_data_client *);
 static void h_svc_whois(hook_data_client *);
@@ -113,7 +112,7 @@ _moddeinit(void)
        unmark_services();
 }
 
-static int
+static void
 me_su(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
        int parc, const char *parv[])
 {
@@ -123,14 +122,14 @@ me_su(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
        {
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                        "Non-service server %s attempting to execute services-only command SU", source_p->name);
-               return 0;
+               return;
        }
 
        if((target_p = find_client(parv[1])) == NULL)
-               return 0;
+               return;
 
        if(!target_p->user)
-               return 0;
+               return;
 
        if(EmptyString(parv[2]))
                target_p->user->suser[0] = '\0';
@@ -142,45 +141,42 @@ me_su(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
                                            EmptyString(target_p->user->suser) ? "*" : target_p->user->suser);
 
        invalidate_bancache_user(target_p);
-
-       return 0;
 }
 
-static int
+static void
 me_login(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
        int parc, const char *parv[])
 {
        if(!IsPerson(source_p))
-               return 0;
+               return;
 
        rb_strlcpy(source_p->user->suser, parv[1], sizeof(source_p->user->suser));
-       return 0;
 }
 
-static int
+static void
 me_rsfnc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
        int parc, const char *parv[])
 {
        struct Client *target_p;
        struct Client *exist_p;
        time_t newts, curts;
-       char note[NICKLEN + 10];
+       char note[NAMELEN + 10];
 
        if(!(source_p->flags & FLAGS_SERVICE))
        {
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                        "Non-service server %s attempting to execute services-only command RSFNC", source_p->name);
-               return 0;
+               return;
        }
 
        if((target_p = find_person(parv[1])) == NULL)
-               return 0;
+               return;
 
        if(!MyClient(target_p))
-               return 0;
+               return;
 
        if(!clean_nick(parv[2], 0) || IsDigit(parv[2][0]))
-               return 0;
+               return;
 
        curts = atol(parv[4]);
 
@@ -189,7 +185,7 @@ me_rsfnc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
         * nicknames before the RSFNC arrives.. --anfl
         */
        if(target_p->tsinfo != curts)
-               return 0;
+               return;
 
        if((exist_p = find_named_client(parv[2])))
        {
@@ -256,9 +252,8 @@ doit:
 
        del_all_accepts(target_p);
 
-       snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
+       snprintf(note, sizeof(note), "Nick: %s", target_p->name);
        rb_note(target_p->localClient->F, note);
-       return 0;
 }
 
 /*
@@ -266,7 +261,7 @@ doit:
 **      parv[1] = duration in seconds (0 to remove)
 **      parv[2] = nick
 */
-static int
+static void
 me_nickdelay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        int duration;
@@ -276,7 +271,7 @@ me_nickdelay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
        {
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                        "Non-service server %s attempting to execute services-only command NICKDELAY", source_p->name);
-               return 0;
+               return;
        }
 
        duration = atoi(parv[1]);
@@ -295,8 +290,6 @@ me_nickdelay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
                if (nd != NULL)
                        nd->expire = rb_current_time() + duration;
        }
-
-       return 0;
 }
 
 static void