Mercurial > pidgin.yaz
comparison src/protocols/irc/msgs.c @ 13637:83ec59aefbe5
[gaim-migrate @ 16035]
Fix Coverity CID 109, if we get a topic for a channel that doesn't exist,
there's no point continuing and trying to set that topic
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Sat, 15 Apr 2006 14:40:55 +0000 |
parents | cfc2f7fcb3dd |
children | e8e5931e7e8d |
comparison
equal
deleted
inserted
replaced
13636:293088b65dac | 13637:83ec59aefbe5 |
---|---|
295 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args) | 295 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args) |
296 { | 296 { |
297 char *chan, *topic, *msg, *nick, *tmp, *tmp2; | 297 char *chan, *topic, *msg, *nick, *tmp, *tmp2; |
298 GaimConversation *convo; | 298 GaimConversation *convo; |
299 | 299 |
300 convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, chan, irc->account); | |
301 if (!convo) { | |
302 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan); | |
303 return; | |
304 } | |
305 | |
300 if (!strcmp(name, "topic")) { | 306 if (!strcmp(name, "topic")) { |
301 chan = args[0]; | 307 chan = args[0]; |
302 topic = irc_mirc2txt (args[1]); | 308 topic = irc_mirc2txt (args[1]); |
303 } else { | 309 } else { |
304 chan = args[1]; | 310 chan = args[1]; |
305 topic = irc_mirc2txt (args[2]); | 311 topic = irc_mirc2txt (args[2]); |
306 } | |
307 | |
308 convo = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, chan, irc->account); | |
309 if (!convo) { | |
310 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan); | |
311 } | 312 } |
312 | 313 |
313 /* If this is an interactive update, print it out */ | 314 /* If this is an interactive update, print it out */ |
314 tmp = g_markup_escape_text(topic, -1); | 315 tmp = g_markup_escape_text(topic, -1); |
315 tmp2 = gaim_markup_linkify(tmp); | 316 tmp2 = gaim_markup_linkify(tmp); |