comparison plugins/timestamp.c @ 6050:72403c3c84e1

[gaim-migrate @ 6500] Fixes a "timestamp plugin sigsegv." That's what happens when you don't initialize your variables. coughseanorchriscough Fixes http://sourceforge.net/tracker/index.php?func=detail&aid=765567&group_id=235&atid=100235 committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 06 Jul 2003 23:33:24 +0000
parents 7d385de2f9cd
children 5239a3b4ab33
comparison
equal deleted inserted replaced
6049:3b8a5846b483 6050:72403c3c84e1
12 #include "gtkplugin.h" 12 #include "gtkplugin.h"
13 #include "gtkutils.h" 13 #include "gtkutils.h"
14 14
15 #define TIMESTAMP_PLUGIN_ID "gtk-timestamp" 15 #define TIMESTAMP_PLUGIN_ID "gtk-timestamp"
16 16
17 //Set the default to 5 minutes. 17 /* Set the default to 5 minutes. */
18 static int timestamp = 5 * 60 * 1000; 18 static int timestamp = 5 * 60 * 1000;
19 19
20 static GSList *timestamp_timeouts; 20 static GSList *timestamp_timeouts;
21 21
22 gboolean do_timestamp (gpointer data) 22 gboolean do_timestamp (gpointer data)
23 { 23 {
24 GaimConversation *c = (GaimConversation *)data; 24 GaimConversation *c = (GaimConversation *)data;
25 char *buf; 25 char *buf;
26 char mdate[6]; 26 char mdate[6];
27 time_t tim = time(NULL); 27 time_t tim = time(NULL);
28 28
29 if (!g_list_find(gaim_get_conversations(), c)) 29 if (!g_list_find(gaim_get_conversations(), c))
30 return FALSE; 30 return FALSE;
31 31
32 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim)); 32 strftime(mdate, sizeof(mdate), "%H:%M", localtime(&tim));
33 buf = g_strdup_printf(" %s", mdate); 33 buf = g_strdup_printf(" %s", mdate);
103 plugin_load(GaimPlugin *plugin) 103 plugin_load(GaimPlugin *plugin)
104 { 104 {
105 GList *cnvs; 105 GList *cnvs;
106 GaimConversation *c; 106 GaimConversation *c;
107 107
108 timestamp_timeouts = NULL;
108 for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) { 109 for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) {
109 c = cnvs->data; 110 c = cnvs->data;
110 timestamp_new_convo(c->name); 111 timestamp_new_convo(c->name);
111 } 112 }
112 113