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>
このコミットが含まれているのは:
Takashi Iwai
2013-10-29 15:26:12 +01:00
コミット 57a4451d26
6個のファイルの変更8行の追加8行の削除

ファイルの表示

@@ -583,7 +583,7 @@ static int ak4xxx_capture_source_info(struct snd_kcontrol *kcontrol,
if (idx >= num_names)
return -EINVAL;
input_names = ak->adc_info[mixer_ch].input_names;
strncpy(uinfo->value.enumerated.name, input_names[idx],
strlcpy(uinfo->value.enumerated.name, input_names[idx],
sizeof(uinfo->value.enumerated.name));
return 0;
}