From 57d098f0c55b9d1d6a9372d01c7c3fb3cfc4a4d8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 24 May 2018 15:47:09 +0200 Subject: [PATCH] input: Fix compiler warning from string operation Change-Id: I486ba2dacf9e058730e5f54f9eadd8ace45875b4 Signed-off-by: Amit Purwar --- profiles/input/device.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/profiles/input/device.c b/profiles/input/device.c index bd9326d..8d22bf7 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -681,8 +681,8 @@ static int create_hid_dev_name(sdp_record_t *rec, struct hidp_connadd_req *req) if (sdp_get_provider_name(rec, pname, sizeof(pname)) == 0 && strncmp(sdesc, pname, 5) != 0) - snprintf(req->name, sizeof(req->name), "%s %s", pname, - sdesc); + snprintf(req->name, sizeof(req->name), "%s %s", + pname, sdesc); else snprintf(req->name, sizeof(req->name), "%s", sdesc); } else { @@ -860,8 +860,7 @@ static int uhid_connadd(struct input_device *idev, struct hidp_connadd_req *req) /* create uHID device */ memset(&ev, 0, sizeof(ev)); ev.type = UHID_CREATE; - strncpy((char *) ev.u.create.name, req->name, - sizeof(ev.u.create.name) - 1); + strncpy((char *) ev.u.create.name, req->name, sizeof(ev.u.create.name)); ba2str(&idev->src, (char *) ev.u.create.phys); ba2str(&idev->dst, (char *) ev.u.create.uniq); ev.u.create.vendor = req->vendor; -- 2.7.4