gcc7 fixes: NICKLEN -> NAMELEN

Use NAMELEN instead of NICKLEN when accessing Client->name because it
could in theory be a HOSTLEN length string.
This commit is contained in:
Simon Arlott 2018-01-19 23:24:55 +00:00
parent 30053ab982
commit fe5fc851aa
No known key found for this signature in database
GPG key ID: 49BFFEEFD4C3ED53
8 changed files with 24 additions and 22 deletions

View file

@ -160,7 +160,7 @@ me_rsfnc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
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))
{
@ -252,7 +252,7 @@ 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);
}

View file

@ -233,11 +233,11 @@ me_svslogin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
}
else
{
char note[NICKLEN + 10];
char note[NAMELEN + 10];
send_signon(NULL, target_p, nick, user, host, rb_current_time(), login);
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);
}
}