ALSA: mixer_oss: Remove deprecated strcpy() function calls

Remove the deprecated strcpy() function calls and assign the strings
directly to a 'char *' instead.

Use 'if/else if' instead of two separate if statements.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250623113855.37031-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Thorsten Blum 2025-06-23 13:38:54 +02:00 committed by Takashi Iwai
parent 87aafc8580
commit d536352204

View File

@ -991,7 +991,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer,
struct slot *pslot;
struct snd_kcontrol *kctl;
struct snd_mixer_oss_slot *rslot;
char str[64];
const char *str;
/* check if already assigned */
if (mixer->slots[ptr->oss_id].get_volume && ! replace_old)
@ -1014,11 +1014,11 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer,
if (kctl->info(kctl, uinfo))
return 0;
strcpy(str, ptr->name);
str = ptr->name;
if (!strcmp(str, "Master"))
strcpy(str, "Mix");
if (!strcmp(str, "Master Mono"))
strcpy(str, "Mix Mono");
str = "Mix";
else if (!strcmp(str, "Master Mono"))
str = "Mix Mono";
slot.capture_item = 0;
if (!strcmp(uinfo->value.enumerated.name, str)) {
slot.present |= SNDRV_MIXER_OSS_PRESENT_CAPTURE;