mirror of
https://github.com/osmarks/ngircd.git
synced 2025-06-03 06:54:09 +00:00
Fix 2 bugs introduced in 74514b8c23
Channel_Modes() and Channel_Topic() return static memory that is zeroed at creation time. Fix checking for empty modes and topic so they're propagated correctly.
This commit is contained in:
parent
aeebde4642
commit
cd38e9580e
@ -688,7 +688,7 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
|
|||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
|
|
||||||
if (Req->argv[1][0] == '+') {
|
if (Req->argv[1][0] == '+') {
|
||||||
if (!Channel_Modes(chan)) {
|
if (!*Channel_Modes(chan)) {
|
||||||
/* OK, this channel doesn't have modes yet,
|
/* OK, this channel doesn't have modes yet,
|
||||||
* set the received ones: */
|
* set the received ones: */
|
||||||
Channel_SetModes(chan, &Req->argv[1][1]);
|
Channel_SetModes(chan, &Req->argv[1][1]);
|
||||||
@ -727,7 +727,7 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
|
|||||||
|
|
||||||
if (arg_topic > 0) {
|
if (arg_topic > 0) {
|
||||||
/* We got a topic */
|
/* We got a topic */
|
||||||
if (!Channel_Topic( chan ) && Req->argv[arg_topic][0]) {
|
if (!*Channel_Topic(chan) && Req->argv[arg_topic][0]) {
|
||||||
/* OK, there is no topic jet */
|
/* OK, there is no topic jet */
|
||||||
Channel_SetTopic(chan, Client, Req->argv[arg_topic]);
|
Channel_SetTopic(chan, Client, Req->argv[arg_topic]);
|
||||||
IRC_WriteStrChannelPrefix(Client, chan, from, false,
|
IRC_WriteStrChannelPrefix(Client, chan, from, false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user