Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118062
b: refs/heads/master
c: 366840d
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Takashi Iwai committed Oct 29, 2008
1 parent cea37dd commit 8776301
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 78fad343a4fd4c837e3034dcbca13269a783e0f6
refs/heads/master: 366840d7e1ece4331bb3ccc2a53e3bc355529f21
7 changes: 6 additions & 1 deletion trunk/sound/core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,13 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
kctl.id.iface = ncontrol->iface;
kctl.id.device = ncontrol->device;
kctl.id.subdevice = ncontrol->subdevice;
if (ncontrol->name)
if (ncontrol->name) {
strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name));
if (strcmp(ncontrol->name, kctl.id.name) != 0)
snd_printk(KERN_WARNING
"Control name '%s' truncated to '%s'\n",
ncontrol->name, kctl.id.name);
}
kctl.id.index = ncontrol->index;
kctl.count = ncontrol->count ? ncontrol->count : 1;
access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
Expand Down

0 comments on commit 8776301

Please sign in to comment.