diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-10 05:55:50 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:44:07 +0200 |
commit | b204fafacf4924bdaf216bebc3f713bf2cca76bf (patch) | |
tree | 4210afa8538cb175d9c4da42491d9af03fa16e40 | |
parent | 81558bfb7b1102eb6a702e53f180c9caf7740cab (diff) | |
download | neard-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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"); |