Skip to contentSkip to conversation

ALSA: es1688: Use strcpy() instead of sprintf()

PATCH Applied Nicolas Iooss 2 participants 2 messages Mar 13, 2017 – Mar 20, 2017 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: es1688: Use strcpy() instead of sprintf()

There is no point in using sprintf() without a format string when strcpy() can perform the same operation.

---
 sound/isa/es1688/es1688_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/es1688/es1688_lib.c +1 -1
index e2cf508841b1..81cf26fa28d6 100644
@@ -742,7 +742,7 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device)
 
 	pcm->private_data = chip;
 	pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
-	sprintf(pcm->name, snd_es1688_chip_id(chip));
+	strcpy(pcm->name, snd_es1688_chip_id(chip));
 	chip->pcm = pcm;
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
Signature · 1 line
2.12.0
Applied
#1 lore raw
Quoted 5 lines · Nicolas Iooss

There is no point in using sprintf() without a format string when strcpy() can perform the same operation.

Applied, thanks.

Takashi

Quoted 25 lines
---
 sound/isa/es1688/es1688_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/es1688/es1688_lib.c +1 -1
index e2cf508841b1..81cf26fa28d6 100644
@@ -742,7 +742,7 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device)
 
 	pcm->private_data = chip;
 	pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
-	sprintf(pcm->name, snd_es1688_chip_id(chip));
+	strcpy(pcm->name, snd_es1688_chip_id(chip));
 	chip->pcm = pcm;
 
 	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
Signature · 6 lines
2.12.0

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel