All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: [PATCH resend] uvc: strncpy -> strscpy
Date: Mon, 1 Feb 2021 09:40:56 +0100	[thread overview]
Message-ID: <4ecb8867-6678-aa1a-3d86-65f815d34f5b@xs4all.nl> (raw)

The use of strncpy is discouraged, use strscpy instead.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 1abc122a0977..30ef2a3110f7 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1553,7 +1553,7 @@ static int uvc_gpio_parse(struct uvc_device *dev)
 	unit->gpio.bmControls[0] = 1;
 	unit->get_cur = uvc_gpio_get_cur;
 	unit->get_info = uvc_gpio_get_info;
-	strncpy(unit->name, "GPIO", sizeof(unit->name) - 1);
+	strscpy(unit->name, "GPIO", sizeof(unit->name));

 	list_add_tail(&unit->list, &dev->entities);


             reply	other threads:[~2021-02-01  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  8:40 Hans Verkuil [this message]
2021-02-04 15:26 ` [PATCH resend] uvc: strncpy -> strscpy Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ecb8867-6678-aa1a-3d86-65f815d34f5b@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.