changeset 667:86bc3295a4db

Fix segfault in scr_setmsgflag_if_needed()
author Mikael Berthe <mikael@lilotux.net>
date Fri, 13 Jan 2006 22:05:38 +0100
parents ff575fa25276
children d0928694c81b
files mcabber/src/screen.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/screen.c	Thu Jan 12 22:54:13 2006 +0100
+++ b/mcabber/src/screen.c	Fri Jan 13 22:05:38 2006 +0100
@@ -1236,8 +1236,13 @@
 // Set the message flag unless we're already in the jid buffer window
 void scr_setmsgflag_if_needed(const char *jid)
 {
-  if (!chatmode || !current_buddy ||
-      strcmp(jid, buddy_getjid(BUDDATA(current_buddy))))
+  const char *current_jid;
+
+  if (current_buddy)
+    current_jid = buddy_getjid(BUDDATA(current_buddy));
+  else
+    current_jid = NULL;
+  if (!chatmode || !current_jid || strcmp(jid, current_jid))
     roster_msg_setflag(jid, TRUE);
 }