Bluetooth: Add define for the maximum name length on HCI level
This patch adds a clear define for the maximum device name length in HCI messages and thereby avoids magic numbers in the code. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:

committed by
Gustavo F. Padovan

parent
f0681a68dd
commit
1f6c6378c5
@@ -200,7 +200,7 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
if (!sent)
|
||||
return;
|
||||
|
||||
memcpy(hdev->dev_name, sent, 248);
|
||||
memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH);
|
||||
}
|
||||
|
||||
static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
@@ -212,7 +212,7 @@ static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
if (rp->status)
|
||||
return;
|
||||
|
||||
memcpy(hdev->dev_name, rp->name, 248);
|
||||
memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH);
|
||||
}
|
||||
|
||||
static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
|
Reference in New Issue
Block a user