fix two issues in snd_device_name_hint()

- returned wrong error when the namehint section does not exist
- variable underflow for the rawmidi interface
This commit is contained in:
Jaroslav Kysela 2006-10-11 13:59:42 +02:00
parent 13fdc41785
commit faf8aad99a

View file

@ -425,7 +425,7 @@ static int add_card(struct hint_list *list, int card, snd_ctl_elem_iface_t iface
int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints) int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
{ {
struct hint_list list; struct hint_list list;
char ehints[16]; char ehints[24];
const char *str; const char *str;
snd_config_t *conf; snd_config_t *conf;
snd_config_iterator_t i, next; snd_config_iterator_t i, next;
@ -466,6 +466,7 @@ int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
goto __error; goto __error;
} }
} }
err = 0;
__error: __error:
if (err < 0) { if (err < 0) {
snd_device_name_free_hint(list.list); snd_device_name_free_hint(list.list);