[linux-nfc] [neard][PATCH v2 14/73] ndef: use NDEF_TEXT_RECORD_UTF16_STATUS define
Krzysztof Kozlowski <[email protected]> Mon, 19 Jul 2021 13:07:20 +0200
| Newsgroups | org.01.lists.linux-nfc,dev.linux.lists.oe-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 _______________________________________________ Linux-nfc mailing list -- [email protected] To unsubscribe send an email to [email protected] %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s