comparison src/log.c @ 5528:c72213437829

[gaim-migrate @ 5928] Dario Sarango (darius_wolfson) writes: "Patch to fix bug #743397 I added some snity checks when removing a log file, to avoid gai segfaulting when removing an invalid/non-existing log file." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 26 May 2003 04:28:11 +0000
parents ad445074d239
children 80e4ba770f97
comparison
equal deleted inserted replaced
5527:166ed121e555 5528:c72213437829
25 #endif 25 #endif
26 26
27 void rm_log(struct log_conversation *a) 27 void rm_log(struct log_conversation *a)
28 { 28 {
29 struct gaim_conversation *cnv = gaim_find_conversation(a->name); 29 struct gaim_conversation *cnv = gaim_find_conversation(a->name);
30
31 /* Added the following if statements for sanity check */
32 if (!a)
33 {
34 gaim_notify_error (NULL, NULL, _("Error in specifying buddy conversation."), NULL);
35 return;
36 }
37 cnv = gaim_find_conversation(a->name);
38 if (!cnv)
39 {
40 gaim_notify_error (NULL, NULL, _("Unable to find conversation log"), NULL);
41 return;
42 }
30 43
31 log_conversations = g_list_remove(log_conversations, a); 44 log_conversations = g_list_remove(log_conversations, a);
32 45
33 save_prefs(); 46 save_prefs();
34 47