pidgin/pidgin

Add some NULL checks to silence scan-build.

2019-11-05, Elliott Sales de Andrade
eda298799a8e
Parents d036854702b3
Children 360997c25b1a
Add some NULL checks to silence scan-build.
--- a/libpurple/protocols/zephyr/zephyr.c Tue Nov 05 20:28:13 2019 -0500
+++ b/libpurple/protocols/zephyr/zephyr.c Tue Nov 05 21:07:41 2019 -0500
@@ -2410,11 +2410,12 @@
const char *instname;
const char *recip;
zephyr_account *zephyr = purple_connection_get_protocol_data(gc);
+
+ g_return_if_fail(zephyr != NULL);
+
classname = g_hash_table_lookup(data, "class");
instname = g_hash_table_lookup(data, "instance");
recip = g_hash_table_lookup(data, "recipient");
-
-
if (!classname)
return;
--- a/pidgin/gtknotify.c Tue Nov 05 20:28:13 2019 -0500
+++ b/pidgin/gtknotify.c Tue Nov 05 21:07:41 2019 -0500
@@ -800,10 +800,10 @@
}
} else {
if (count > 0) {
- notification = g_strdup_printf(ngettext("%s has %d new message.",
- "%s has %d new messages.",
- (int)count),
- *tos, (int)count);
+ notification = g_strdup_printf(
+ ngettext("%s has %d new message.",
+ "%s has %d new messages.", (int)count),
+ tos ? *tos : "(unknown)", (int)count);
data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE, &new_data);
if (data2 && new_data) {
data = data2;