mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
seq: Fix for snd_seq_parse_address()
snd_seq_parse_address() uses strncmp() to compare the client name in the string argument with the existing clients, until it finds one name matching the same leading characters. This may produce wrong results when there are two sequencer clients with similar names. Example: "KMidimon" : "Kmid" Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
8d80d5f344
commit
1989233449
1 changed files with 2 additions and 1 deletions
|
|
@ -414,7 +414,8 @@ int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *arg)
|
|||
return -EINVAL;
|
||||
cinfo.client = -1;
|
||||
while (snd_seq_query_next_client(seq, &cinfo) >= 0) {
|
||||
if (! strncmp(arg, cinfo.name, len)) {
|
||||
if ((strlen(cinfo.name) == len) &&
|
||||
! strncmp(arg, cinfo.name, len)) {
|
||||
addr->client = cinfo.client;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue