X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/ac408af6cba5a230c66186d4389e60766c3a74a4..fa2a410abe67fe0a1327eec149451b971ab53360:/modules/m_who.c diff --git a/modules/m_who.c b/modules/m_who.c index 63fb2ed..834ab75 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -442,7 +442,7 @@ append_format(char *buf, size_t bufsize, size_t *pos, const char *fmt, ...) max = *pos >= bufsize ? 0 : bufsize - *pos; va_start(ap, fmt); - result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap); + result = rb_vsnprintf(buf + *pos, max, fmt, ap); va_end(ap); *pos += result; } @@ -467,7 +467,7 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt const char *q; rb_sprintf(status, "%c%s%s", - target_p->user->away ? 'G' : 'H', IsOper(target_p) ? "*" : "", msptr ? find_channel_status(msptr, fmt->fields || IsCapable(source_p, CLICAP_MULTI_PREFIX)) : ""); + (get_metadata(target_p, "away") != NULL) ? 'G' : 'H', IsOper(target_p) ? "*" : "", msptr ? find_channel_status(msptr, fmt->fields || IsCapable(source_p, CLICAP_MULTI_PREFIX)) : ""); if (fmt->fields == 0) sendto_one(source_p, form_str(RPL_WHOREPLY), me.name,