]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fix two issues in snd_device_name_hint()
authorJaroslav Kysela <perex@perex.cz>
Wed, 11 Oct 2006 11:59:42 +0000 (13:59 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 11 Oct 2006 11:59:42 +0000 (13:59 +0200)
- returned wrong error when the namehint section does not exist
- variable underflow for the rawmidi interface

src/control/namehint.c

index e787b9df5f0abf4922ed799ce7d06f4669cbae18..4e5b0b01c03d14d990f12b0ae14addf9eb8f2bee 100644 (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)
 {
        struct hint_list list;
-       char ehints[16];
+       char ehints[24];
        const char *str;
        snd_config_t *conf;
        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;
                }
        }
+       err = 0;
       __error:
        if (err < 0) {
                snd_device_name_free_hint(list.list);