]> jfr.im git - solanum.git/blobdiff - modules/m_who.c
As in shadowircd, increase buffer for /who status.
[solanum.git] / modules / m_who.c
index 2175fcc5c003adc4d84946c30b91be5b72547635..0b63a4bb045576d21bb276560614a18baaf83700 100644 (file)
@@ -102,6 +102,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa
        int operspy = 0;
        struct who_format fmt;
        const char *s;
+       char maskcopy[512];
 
        fmt.fields = 0;
        fmt.querytype = NULL;
@@ -137,7 +138,8 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa
                        fmt.querytype = "0";
        }
 
-       mask = LOCAL_COPY(parv[1]);
+       rb_strlcpy(maskcopy, parv[1], sizeof maskcopy);
+       mask = maskcopy;
 
        collapse(mask);
 
@@ -435,7 +437,7 @@ do_who_on_channel(struct Client *source_p, struct Channel *chptr,
 static void
 do_who(struct Client *source_p, struct Client *target_p, struct membership *msptr, struct who_format *fmt)
 {
-       char status[5];
+       char status[16];
        char str[512], *p, *end;
        const char *q;
 
@@ -478,7 +480,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt
                if (fmt->fields & FIELD_HOP)
                        p += rb_snprintf(p, end - p, " %d", ConfigServerHide.flatten_links ? 0 : target_p->hopcount);
                if (fmt->fields & FIELD_IDLE)
-                       p += rb_snprintf(p, end - p, " %d", MyClient(target_p) ? rb_current_time() - target_p->localClient->last : 0);
+                       p += rb_snprintf(p, end - p, " %d", (int)(MyClient(target_p) ? rb_current_time() - target_p->localClient->last : 0));
                if (fmt->fields & FIELD_ACCOUNT)
                {
                        /* display as in whois */