ALSA: core: control_led: use strscpy instead of strlcpy
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 12 Aug 2021 22:59:03 +0000 (17:59 -0500)
committerTakashi Iwai <tiwai@suse.de>
Fri, 13 Aug 2021 06:05:17 +0000 (08:05 +0200)
strlcpy is deprecated, use its safe replacement

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210812225904.171529-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/control_led.c

index 764058cc345d120ae943b785dee3c5fa9da2ec44..a95332b2b90b0620a3e311852c1dd3b78fea3fa8 100644 (file)
@@ -564,7 +564,7 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
                        else {
                                for (; *s >= ' '; s++);
                                *s = '\0';
-                               strlcpy(id.name, buf2, sizeof(id.name));
+                               strscpy(id.name, buf2, sizeof(id.name));
                        }
                        break;
                }