Do a NULL-check to prevent a crash.

Mon, 16 Jul 2007 23:59:58 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Mon, 16 Jul 2007 23:59:58 +0000
changeset 18809
5ba9bf0804fe
parent 18808
894912f850f6
child 18810
59302a4de5ae
child 18811
9049a18d56b6
child 18826
a276583c694c

Do a NULL-check to prevent a crash.

finch/libgnt/gntwm.c file | annotate | diff | comparison | revisions
--- a/finch/libgnt/gntwm.c	Mon Jul 16 23:50:41 2007 +0000
+++ b/finch/libgnt/gntwm.c	Mon Jul 16 23:59:58 2007 +0000
@@ -914,7 +914,7 @@
 	len = wcstombs(NULL, wide, 0) + 1;
 	string = g_new0(char, len);
 	wcstombs(string, wide, len);
-	ret = gnt_util_onscreen_width(string, NULL);
+	ret = string ? gnt_util_onscreen_width(string, NULL) : 1;
 	g_free(string);
 	return ret;
 }

mercurial