Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thorsten Blum and committed by
Takashi Iwai
d5363522 87aafc85

+5 -5
+5 -5
sound/core/oss/mixer_oss.c
··· 991 991 struct slot *pslot; 992 992 struct snd_kcontrol *kctl; 993 993 struct snd_mixer_oss_slot *rslot; 994 - char str[64]; 994 + const char *str; 995 995 996 996 /* check if already assigned */ 997 997 if (mixer->slots[ptr->oss_id].get_volume && ! replace_old) ··· 1014 1014 1015 1015 if (kctl->info(kctl, uinfo)) 1016 1016 return 0; 1017 - strcpy(str, ptr->name); 1017 + str = ptr->name; 1018 1018 if (!strcmp(str, "Master")) 1019 - strcpy(str, "Mix"); 1020 - if (!strcmp(str, "Master Mono")) 1021 - strcpy(str, "Mix Mono"); 1019 + str = "Mix"; 1020 + else if (!strcmp(str, "Master Mono")) 1021 + str = "Mix Mono"; 1022 1022 slot.capture_item = 0; 1023 1023 if (!strcmp(uinfo->value.enumerated.name, str)) { 1024 1024 slot.present |= SNDRV_MIXER_OSS_PRESENT_CAPTURE;