changeset 5:6ac1867d7e8e

string list should be initialized with NULL
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 30 Apr 2008 17:02:47 +0900
parents 9ac8cea32513
children ca8f95431962
files pidgin-twitter.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Wed Apr 30 15:47:33 2008 +0900
+++ b/pidgin-twitter.c	Wed Apr 30 17:02:47 2008 +0900
@@ -93,6 +93,7 @@
     GList *list, *lp;
 
     list = purple_prefs_get_string_list(OPT_USERLIST);
+    g_return_if_fail(list != NULL);
 
     g_regex_match (preg, *str, 0, &match_info);
     while (g_match_info_matches (match_info))
@@ -218,20 +219,16 @@
 static void
 init_plugin(PurplePlugin *plugin)
 {
-    GList *list;
-
 	g_type_init();
-    list = g_list_alloc();
 
 	/* add plugin preferences */
 	purple_prefs_add_none(OPT_PIDGINTWITTER);
 	purple_prefs_add_bool(OPT_TRANSLATE, TRUE);
 	purple_prefs_add_bool(OPT_PLAYSOUND, TRUE);
-	purple_prefs_add_string_list(OPT_USERLIST, list);
+	purple_prefs_add_string_list(OPT_USERLIST, NULL);
 
     /* compile regex */
-    preg = g_regex_new("@[A-Za-z0-9-_]+", 0, 0, NULL);
-
+    preg = g_regex_new("@[A-Za-z0-9_]+", 0, 0, NULL);
 }
 
 PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info)