ALSA: Use strlcpy() instead of strncpy()
We tend to make stupid mistakes with strncpy(). Let's take a safer one, strlcpy(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -161,13 +161,13 @@ int olpc_quirks(struct snd_card *card, struct snd_ac97 *ac97)
|
||||
/* drop the original AD1888 HPF control */
|
||||
memset(&elem, 0, sizeof(elem));
|
||||
elem.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
|
||||
strncpy(elem.name, "High Pass Filter Enable", sizeof(elem.name));
|
||||
strlcpy(elem.name, "High Pass Filter Enable", sizeof(elem.name));
|
||||
snd_ctl_remove_id(card, &elem);
|
||||
|
||||
/* drop the original V_REFOUT control */
|
||||
memset(&elem, 0, sizeof(elem));
|
||||
elem.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
|
||||
strncpy(elem.name, "V_REFOUT Enable", sizeof(elem.name));
|
||||
strlcpy(elem.name, "V_REFOUT Enable", sizeof(elem.name));
|
||||
snd_ctl_remove_id(card, &elem);
|
||||
|
||||
/* add the OLPC-specific controls */
|
||||
|
Reference in New Issue
Block a user