diff options
author | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2014-01-11 00:47:19 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-01-11 18:56:03 +0200 |
commit | 95b8a4ec80ee32a712646106d39435ecc41bf3f4 (patch) | |
tree | c37e8f467cfb39adb7ecdc9242a105eef982ae24 | |
parent | a2c1b506f7340d5d665851ca3e7e52c2df18557e (diff) | |
download | bluez-95b8a4ec80ee32a712646106d39435ecc41bf3f4.tar.gz |
attrib: Use att_put_u16() instead of htobs() + memcpy()
-rw-r--r-- | attrib/att.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/attrib/att.c b/attrib/att.c index 753c75398..d9ca70921 100644 --- a/attrib/att.c +++ b/attrib/att.c @@ -723,15 +723,13 @@ uint16_t enc_error_resp(uint8_t opcode, uint16_t handle, uint8_t status, { const uint16_t min_len = sizeof(pdu[0]) + sizeof(opcode) + sizeof(handle) + sizeof(status); - uint16_t u16; if (len < min_len) return 0; - u16 = htobs(handle); pdu[0] = ATT_OP_ERROR; pdu[1] = opcode; - memcpy(&pdu[2], &u16, sizeof(u16)); + att_put_u16(handle, &pdu[2]); pdu[4] = status; return min_len; |