From 3af4b2348823450c134e0565f66b6c90411c1093 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 May 2018 16:35:32 +0200 Subject: [PATCH] lib: Fix compiler warning from wrong array size --- lib/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hci.c b/lib/hci.c index 4e69274d2..28e53f490 100644 --- a/lib/hci.c +++ b/lib/hci.c @@ -1605,7 +1605,7 @@ int hci_write_local_name(int dd, const char *name, int to) struct hci_request rq; memset(&cp, 0, sizeof(cp)); - strncpy((char *) cp.name, name, sizeof(cp.name)); + strncpy((char *) cp.name, name, sizeof(cp.name) - 1); memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; -- 2.47.3