From ff2553027cb10a62978bc8293828929b12aeb4bb Mon Sep 17 00:00:00 2001 From: Wiktor Lawski Date: Wed, 19 Sep 2012 15:20:44 +0200 Subject: [PATCH] nfctype1: Improve nfctype1_read readability WHEN either uid is NULL or uid_length is not equal to UID_LENGTH AND uid is not NULL, uid_length must to be NOT equal to UID_LENGTH, so additional conditional in if statement is not necessary. It will be always true. It is only harder to analyze function code. --- plugins/nfctype1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nfctype1.c b/plugins/nfctype1.c index 7fb4e0c..d7ba35e 100644 --- a/plugins/nfctype1.c +++ b/plugins/nfctype1.c @@ -412,7 +412,7 @@ static int nfctype1_read(uint32_t adapter_idx, uid = near_tag_get_nfcid(adapter_idx, target_idx, &uid_length); if (uid == NULL || uid_length != UID_LENGTH) { - if (uid != NULL && uid_length != UID_LENGTH) { + if (uid != NULL) { near_error("Invalid UID"); g_free(uid); -- 2.7.4