summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@lodoss.net>2013-08-11 20:57:11 +0100
committerFederico G. Schwindt <fgsch@lodoss.net>2013-08-11 20:57:11 +0100
commitcd38e9580e428103cef39e2e29f62472b2f336d3 (patch)
tree96e60d4252e78ed956e6ea4e3c62edcc12596f33 /src
parentaeebde4642580e806c04a339bb9befd1ece61775 (diff)
downloadngircd-cd38e9580e428103cef39e2e29f62472b2f336d3.tar.gz
ngircd-cd38e9580e428103cef39e2e29f62472b2f336d3.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc-channel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c
index 17ecbf93..0978a19d 100644
--- a/src/ngircd/irc-channel.c
+++ b/src/ngircd/irc-channel.c
@@ -688,7 +688,7 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
 		return CONNECTED;
 
 	if (Req->argv[1][0] == '+') {
-		if (!Channel_Modes(chan)) {
+		if (!*Channel_Modes(chan)) {
 			/* OK, this channel doesn't have modes yet,
 			 * set the received ones: */
 			Channel_SetModes(chan, &Req->argv[1][1]);
@@ -727,7 +727,7 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
 
 	if (arg_topic > 0) {
 		/* 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 */
 			Channel_SetTopic(chan, Client, Req->argv[arg_topic]);
 			IRC_WriteStrChannelPrefix(Client, chan, from, false,