From 95b8a4ec80ee32a712646106d39435ecc41bf3f4 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sat, 11 Jan 2014 00:47:19 -0400 Subject: [PATCH] attrib: Use att_put_u16() instead of htobs() + memcpy() --- attrib/att.c | 4 +--- 1 file changed, 1 insertion(+), 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; -- 2.47.3