pidgin/pidgin

Use purple_debug_fatal only if actually fatal

2021-10-12, Elliott Sales de Andrade
fa2d6b0a4912
Parents 741992355ead
Children 1599afdbe1d7
Use purple_debug_fatal only if actually fatal

GLib's fatal logging aborts, which we don't do, but might in the future.

Testing Done:
Compiled only.

Reviewed at https://reviews.imfreedom.org/r/1029/
--- a/libpurple/plugins/keyrings/wincred.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/plugins/keyrings/wincred.c Tue Oct 12 02:38:12 2021 -0500
@@ -72,7 +72,7 @@
g_utf8_to_utf16(target_name_utf8, -1, NULL, NULL, error);
if (target_name_utf16 == NULL) {
- purple_debug_fatal("keyring-wincred", "Couldn't convert target name");
+ purple_debug_error("keyring-wincred", "Couldn't convert target name");
return NULL;
}
@@ -197,7 +197,7 @@
NULL, NULL, &error);
if (username_utf16 == NULL) {
g_free(target_name);
- purple_debug_fatal("keyring-wincred", "Couldn't convert username");
+ purple_debug_error("keyring-wincred", "Couldn't convert username");
g_task_return_error(task, error);
g_object_unref(G_OBJECT(task));
return;
@@ -207,7 +207,7 @@
if (password_utf16 == NULL) {
g_free(username_utf16);
g_free(target_name);
- purple_debug_fatal("keyring-wincred", "Couldn't convert password");
+ purple_debug_error("keyring-wincred", "Couldn't convert password");
g_task_return_error(task, error);
g_object_unref(G_OBJECT(task));
return;
--- a/libpurple/protocols/gg/chat.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/protocols/gg/chat.c Tue Oct 12 02:38:12 2021 -0500
@@ -227,8 +227,8 @@
} else if (ev->type == GG_EVENT_CHAT_INVITE_ACK) {
/* ignore */
} else {
- purple_debug_fatal("gg", "ggp_chat_got_event: unexpected event "
- "- %d\n", ev->type);
+ purple_debug_error("gg", "ggp_chat_got_event: unexpected event - %d",
+ ev->type);
}
}
--- a/libpurple/protocols/gg/edisc.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/protocols/gg/edisc.c Tue Oct 12 02:38:12 2021 -0500
@@ -388,7 +388,7 @@
{
GGPXfer *edisc_xfer = GGP_XFER(xfer);
if (!edisc_xfer) {
- purple_debug_fatal(
+ purple_debug_error(
"gg",
"ggp_edisc_event_ticket_changed: transfer %p already free'd",
xfer);
--- a/libpurple/protocols/gg/libgaduw.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/protocols/gg/libgaduw.c Tue Oct 12 02:38:12 2021 -0500
@@ -91,9 +91,9 @@
ret = vsnprintf(msgbuff, sizeof(msgbuff) / sizeof(char), format, args);
if (ret <= 0) {
- purple_debug_fatal("gg",
+ purple_debug_error("gg",
"failed to printf the following message: %s",
- format ? format : "(null)\n");
+ format ? format : "(null)");
return;
}
--- a/libpurple/protocols/gg/message-prpl.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/protocols/gg/message-prpl.c Tue Oct 12 02:38:12 2021 -0500
@@ -628,8 +628,9 @@
g_match_info_free(match);
if (pos < strlen(text_new) || in_any_tag) {
- purple_debug_fatal("gg", "ggp_message_format_to_gg: "
- "end of message not reached\n");
+ purple_debug_error(
+ "gg",
+ "ggp_message_format_to_gg: end of message not reached");
}
/* releasing fonts resources */
--- a/libpurple/protocols/gg/roster.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/protocols/gg/roster.c Tue Oct 12 02:38:12 2021 -0500
@@ -996,17 +996,15 @@
gboolean succ = FALSE;
updates_it = g_list_next(updates_it);
- if (change->type == GGP_ROSTER_CHANGE_CONTACT_UPDATE)
- succ = ggp_roster_send_update_contact_update(gc,
- change);
- else if (change->type == GGP_ROSTER_CHANGE_CONTACT_REMOVE)
- succ = ggp_roster_send_update_contact_remove(gc,
- change);
- else if (change->type == GGP_ROSTER_CHANGE_GROUP_RENAME)
+ if (change->type == GGP_ROSTER_CHANGE_CONTACT_UPDATE) {
+ succ = ggp_roster_send_update_contact_update(gc, change);
+ } else if (change->type == GGP_ROSTER_CHANGE_CONTACT_REMOVE) {
+ succ = ggp_roster_send_update_contact_remove(gc, change);
+ } else if (change->type == GGP_ROSTER_CHANGE_GROUP_RENAME) {
succ = ggp_roster_send_update_group_rename(gc, change);
- else
- purple_debug_fatal("gg", "ggp_roster_send_update: "
- "not handled\n");
+ } else {
+ purple_debug_error("gg", "ggp_roster_send_update: not handled");
+ }
g_return_if_fail(succ);
}
--- a/libpurple/protocols/gg/status.c Tue Oct 12 00:50:59 2021 -0500
+++ b/libpurple/protocols/gg/status.c Tue Oct 12 02:38:12 2021 -0500
@@ -389,9 +389,10 @@
struct gg_event_status60 *notify = &ev->event.status60;
ggp_status_got_others_buddy(gc, notify->uin,
GG_S(notify->status), notify->descr);
- } else
- purple_debug_fatal("gg", "ggp_status_got_others: "
- "unexpected event %d\n", ev->type);
+ } else {
+ purple_debug_error("gg", "ggp_status_got_others: unexpected event %d",
+ ev->type);
+ }
}
void ggp_status_got_others_buddy(PurpleConnection *gc, uin_t uin, int status,