[neard][PATCH v2 14/73] ndef: use NDEF_TEXT_RECORD_UTF16_STATUS define

Krzysztof Kozlowski <[email protected]>
Newsgroups dev.linux.lists.oe-linux-nfc,org.01.lists.linux-nfc
Message-ID <[email protected]>
Don't hard-code 0x80 because there is a define for it.  No functional
change.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
 src/ndef.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ndef.c b/src/ndef.c
index 13e3356c2c4c..928e6a10a999 100644
--- a/src/ndef.c
+++ b/src/ndef.c
@@ -1164,8 +1164,8 @@ parse_text_payload(uint8_t *payload, uint32_t length)
 	if (!text_payload)
 		return NULL;
 
-	/* 0x80 is used to get 7th bit value (0th bit is LSB) */
-	status = ((payload[offset] & 0x80) >> 7);
+	/* 0th bit is LSB */
+	status = ((payload[offset] & NDEF_TEXT_RECORD_UTF16_STATUS) >> 7);
 
 	text_payload->encoding = (status == 0) ?
 					g_strdup("UTF-8") : g_strdup("UTF-16");
-- 
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.