summaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm_lib.c')
-rw-r--r--sound/core/pcm_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 66683656fb13..6e7905749c4a 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -543,8 +543,8 @@ void snd_pcm_set_sync_per_card(struct snd_pcm_substream *substream,
const unsigned char *id, unsigned int len)
{
*(__u32 *)params->sync = cpu_to_le32(substream->pcm->card->number);
- len = max(12, len);
- strncpy(params->sync + 4, id, len);
+ len = min(12, len);
+ memcpy(params->sync + 4, id, len);
memset(params->sync + 4 + len, 0, 12 - len);
}
EXPORT_SYMBOL_GPL(snd_pcm_set_sync_per_card);