summaryrefslogtreecommitdiffstats
path: root/src/phonebook.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-11-27 17:39:03 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-11-29 13:27:15 -0600
commitb210838e87b737911a9bfbcf75ccd3d78736dad7 (patch)
tree91a91e0a120c70283b5ae3af0776cc19ab36fc76 /src/phonebook.c
parent42bafa260a844c46d1de2f878464165bfad0ab75 (diff)
downloadofono-b210838e87b737911a9bfbcf75ccd3d78736dad7.tar.bz2
core: explicitly compare pointers to NULL
This patch was generated by the following semantic patch (http://coccinelle.lip6.fr/) // <smpl> @fix disable is_null,isnt_null1@ expression *E; @@ - !E + E == NULL // </smpl>
Diffstat (limited to 'src/phonebook.c')
-rw-r--r--src/phonebook.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/phonebook.c b/src/phonebook.c
index cae2b14c..e388ac1e 100644
--- a/src/phonebook.c
+++ b/src/phonebook.c
@@ -155,7 +155,7 @@ static void vcard_printf_number(GString *vcards, const char *number, int type,
char *pref = "", *intl = "", *category_string = "";
char buf[128];
- if (!number || !strlen(number) || !type)
+ if (number == NULL || !strlen(number) || !type)
return;
switch (category) {
@@ -277,8 +277,7 @@ static DBusMessage *generate_export_entries_reply(struct ofono_phonebook *pb,
DBusMessageIter iter;
reply = dbus_message_new_method_return(msg);
-
- if (!reply)
+ if (reply == NULL)
return NULL;
dbus_message_iter_init_append(reply, &iter);
@@ -292,7 +291,7 @@ static gboolean need_merge(const char *text)
int len;
char c;
- if (!text)
+ if (text == NULL)
return FALSE;
len = strlen(text);
@@ -375,7 +374,7 @@ void ofono_phonebook_entry(struct ofono_phonebook *phonebook, int index,
break;
}
- if (!l) {
+ if (l == NULL) {
person = g_new0(struct phonebook_person, 1);
phonebook->merge_list =
g_slist_prepend(phonebook->merge_list, person);
@@ -444,8 +443,7 @@ static void export_phonebook(struct ofono_phonebook *phonebook)
}
reply = generate_export_entries_reply(phonebook, phonebook->pending);
-
- if (!reply) {
+ if (reply == NULL) {
dbus_message_unref(phonebook->pending);
return;
}