From efa3d68daf96d9c64ec1b3b5a0a8ac517c8ae182 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 May 2018 16:35:43 +0200 Subject: [PATCH] input: Fix compiler warning from wrong array size --- profiles/input/hog-lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c index dab385fe7..d9ed80689 100644 --- a/profiles/input/hog-lib.c +++ b/profiles/input/hog-lib.c @@ -998,7 +998,8 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen, return; } - strncpy((char *) ev.u.create.name, hog->name, sizeof(ev.u.create.name)); + strncpy((char *) ev.u.create.name, hog->name, + sizeof(ev.u.create.name) - 1); ev.u.create.vendor = hog->vendor; ev.u.create.product = hog->product; ev.u.create.version = hog->version; -- 2.47.3