diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-11-27 17:39:03 -0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-11-29 13:12:04 -0600 |
commit | 42bafa260a844c46d1de2f878464165bfad0ab75 (patch) | |
tree | 3275a81e1bdf776f03231f1ae3a2fad11c7c262e /src/simutil.c | |
parent | 7484d799c9eb28bc895046c145b979ae834edc32 (diff) | |
download | ofono-42bafa260a844c46d1de2f878464165bfad0ab75.tar.bz2 |
simutil: 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/simutil.c')
-rw-r--r-- | src/simutil.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/simutil.c b/src/simutil.c index 58ea81d1..b9a8bbb6 100644 --- a/src/simutil.c +++ b/src/simutil.c @@ -939,7 +939,7 @@ struct sim_spdi *sim_spdi_new(const guint8 *tlv, int length) plmn_list = ber_tlv_find_by_tag(plmn_list_tlv, 0x80, tlv_length, &list_length); - if (!plmn_list) + if (plmn_list == NULL) return NULL; spdi = g_new0(struct sim_spdi, 1); @@ -963,7 +963,7 @@ gboolean sim_spdi_lookup(struct sim_spdi *spdi, { struct spdi_operator spdi_op; - if (!spdi) + if (spdi == NULL) return FALSE; g_strlcpy(spdi_op.mcc, mcc, sizeof(spdi_op.mcc)); @@ -1011,7 +1011,7 @@ void sim_eons_add_pnn_record(struct sim_eons *eons, int record, name = ber_tlv_find_by_tag(tlv, 0x43, length, &namelength); - if (!name || !namelength) + if (name == NULL || !namelength) return; oper->longname = sim_network_name_parse(name, namelength, @@ -1119,7 +1119,7 @@ static const struct sim_eons_operator_info * break; } - if (!l) + if (l == NULL) return NULL; opl = l->data; @@ -1316,7 +1316,7 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len, */ tlv = ber_tlv_find_by_tag(fcp, 0x80, fcp_length, &tlv_length); - if (!tlv || tlv_length < 2) + if (tlv == NULL || tlv_length < 2) return FALSE; flen = tlv[0]; @@ -1325,14 +1325,14 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len, tlv = ber_tlv_find_by_tag(fcp, 0x83, fcp_length, &tlv_length); - if (!tlv || tlv_length != 2) + if (tlv == NULL || tlv_length != 2) return FALSE; id = (tlv[0] << 8) | tlv[1]; tlv = ber_tlv_find_by_tag(fcp, 0x82, fcp_length, &tlv_length); - if (!tlv || (tlv_length != 2 && tlv_length != 5)) + if (tlv == NULL || (tlv_length != 2 && tlv_length != 5)) return FALSE; if (tlv[1] != 0x21) @@ -1381,7 +1381,7 @@ gboolean sim_parse_3g_get_response(const unsigned char *data, int len, acc[2] = 0x44; - if (!info) + if (info == NULL) acc[0] = 0x11; else acc[0] = (info->perm_read << 4) | info->perm_update; |