diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-09-25 12:49:44 +0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-09-27 18:10:15 -0300 |
commit | fcb73338ed531dcc00cb17ca76fe3e05f774e4e9 (patch) | |
tree | 80598b5be53f9187cd290982012822d5666bc194 /net/bluetooth/hidp | |
parent | 6ed93dc6427d14cdfe0b272cc0a9ee4685ce9ad7 (diff) | |
download | blackbird-op-linux-fcb73338ed531dcc00cb17ca76fe3e05f774e4e9.tar.gz blackbird-op-linux-fcb73338ed531dcc00cb17ca76fe3e05f774e4e9.zip |
Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr
Instead of old unsafe batostr function use %pMR print specifier
for printing Bluetooth addresses in sprintf and seq_printf
statements.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hidp')
-rw-r--r-- | net/bluetooth/hidp/core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index ccd985da6518..0c0028463fa3 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -932,8 +932,12 @@ static int hidp_setup_hid(struct hidp_session *session, hid->country = req->country; strncpy(hid->name, req->name, 128); - strncpy(hid->phys, batostr(&bt_sk(session->ctrl_sock->sk)->src), 64); - strncpy(hid->uniq, batostr(&bt_sk(session->ctrl_sock->sk)->dst), 64); + + snprintf(hid->phys, sizeof(hid->phys), "%pMR", + &bt_sk(session->ctrl_sock->sk)->src); + + snprintf(hid->uniq, sizeof(hid->uniq), "%pMR", + &bt_sk(session->ctrl_sock->sk)->dst); hid->dev.parent = &session->conn->dev; hid->ll_driver = &hidp_hid_driver; |