]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fixed possible segfault in snd_seq_parse_address
authorTakashi Iwai <tiwai@suse.de>
Wed, 19 Sep 2001 20:10:32 +0000 (20:10 +0000)
committerTakashi Iwai <tiwai@suse.de>
Wed, 19 Sep 2001 20:10:32 +0000 (20:10 +0000)
src/seq/seqmid.c

index 6b832ccb06e642ab1b772c4f4714a238d8888f28..bc46fa10b2d05de7f585d8f0ccb2150d0238c9f3 100644 (file)
@@ -383,12 +383,11 @@ int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *arg)
 
                if (! seq)
                        return -EINVAL;
-               *p = 0;
                if (len <= 0)
                        return -EINVAL;
                cinfo.client = -1;
                while (snd_seq_query_next_client(seq, &cinfo) >= 0) {
-                       if (! strncmp(cinfo.name, arg, len)) {
+                       if (! strncmp(arg, cinfo.name, len)) {
                                addr->client = cinfo.client;
                                return 0;
                        }