aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-10 05:55:50 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-07-19 12:44:07 +0200
commitb204fafacf4924bdaf216bebc3f713bf2cca76bf (patch)
tree4210afa8538cb175d9c4da42491d9af03fa16e40
parent81558bfb7b1102eb6a702e53f180c9caf7740cab (diff)
downloadneard-b204fafacf4924bdaf216bebc3f713bf2cca76bf.tar.gz
ndef: use NDEF_TEXT_RECORD_UTF16_STATUS define
Don't hard-code 0x80 because there is a define for it. No functional change. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r--src/ndef.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ndef.c b/src/ndef.c
index 13e3356..928e6a1 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");