Fix r_list_set_n() to allow empty element (#15820) ##util
This commit is contained in:
parent
9ddfafcd65
commit
6928ae192d
|
@ -416,7 +416,7 @@ R_API int r_list_set_n(RList *list, int n, void *p) {
|
|||
int i;
|
||||
|
||||
r_return_val_if_fail (list, false);
|
||||
for (it = list->head, i = 0; it && it->data; it = it->n, i++) {
|
||||
for (it = list->head, i = 0; it ; it = it->n, i++) {
|
||||
if (i == n) {
|
||||
if (list->free) {
|
||||
list->free (it->data);
|
||||
|
|
Loading…
Reference in New Issue