diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-06-27 08:59:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-06-27 12:11:32 -0400 |
commit | c288248f5b26cd5563112fcdc077bf44964a942d (patch) | |
tree | 5217e0facab2451426d72e844afd90c33ec13594 | |
parent | 401caff70cd3d3ef3c96e1a1cbf6f973c24ba899 (diff) |
ALSA: intel_hdmi: Use strlcpy() instead of strncpy()
hdmi_lpe_audio_probe() copies the pcm name string via strncpy(), but
as a gcc8 warning suggests, it misses a NUL terminator, and unlikely
the expected result.
Use the proper one, strlcpy() instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/x86/intel_hdmi_audio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 4ed9d0c41843..edc9f5a34eff 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c | |||
@@ -1854,7 +1854,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) | |||
1854 | /* setup private data which can be retrieved when required */ | 1854 | /* setup private data which can be retrieved when required */ |
1855 | pcm->private_data = ctx; | 1855 | pcm->private_data = ctx; |
1856 | pcm->info_flags = 0; | 1856 | pcm->info_flags = 0; |
1857 | strncpy(pcm->name, card->shortname, strlen(card->shortname)); | 1857 | strlcpy(pcm->name, card->shortname, strlen(card->shortname)); |
1858 | /* setup the ops for playabck */ | 1858 | /* setup the ops for playabck */ |
1859 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &had_pcm_ops); | 1859 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &had_pcm_ops); |
1860 | 1860 | ||