[Bug Fix] Fix #set motd Crash (#4495)

This commit is contained in:
Alex King 2024-10-05 08:58:22 -04:00 committed by GitHub
parent 7eaee2649e
commit 1fb7a860a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ void SetMOTD(Client *c, const Seperator *sep)
auto m = (ServerMotd_Struct *) pack->pBuffer;
strn0cpy(m->myname, c->GetName(), sizeof(m->myname));
strn0cpy(m->motd, message.c_str(), sizeof(m->motd));
strn0cpy(m->motd, !message.empty() ? message.c_str() : "", sizeof(m->motd));
worldserver.SendPacket(pack);
safe_delete(pack);