--- attrib/att.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/attrib/att.c b/attrib/att.c index 753c753..d9ca709 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; -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html