Skip to content

Commit

Permalink
core: fix to xavp_rm_internal (#2604)
Browse files Browse the repository at this point in the history
This fixes the following issue:
#2604

Description of the issue:

When called to remove a specific index from a given xavp, function xavp_rm_by_index removes the index (as expected) but also all others before it.

E.g :
If called with idx = 1, it removes indexes 0 and 1.
Likewise if invoked with idx = 2 => the first 3 elements are removed.

This bug is located in function xavp_rm_internal. An assignment was missing when looping over the xavp list.
Same for xavi_rm_internal.
  • Loading branch information
nchaigne committed Jan 22, 2021
1 parent 4a4f047 commit 1241497
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/xavp.c
Expand Up @@ -454,6 +454,8 @@ static int xavp_rm_internal(str *name, sr_xavp_t **head, int idx)
if(idx>=0)
return 1;
count++;
} else {
prv = foo;
}
n++;
} else {
Expand Down Expand Up @@ -1914,6 +1916,8 @@ static int xavi_rm_internal(str *name, sr_xavp_t **head, int idx)
if(idx>=0)
return 1;
count++;
} else {
prv = foo;
}
n++;
} else {
Expand Down

0 comments on commit 1241497

Please sign in to comment.