Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on page iterators.org #35

Open
Robpaa opened this issue Oct 1, 2019 · 0 comments
Open

Bug on page iterators.org #35

Robpaa opened this issue Oct 1, 2019 · 0 comments

Comments

@Robpaa
Copy link

Robpaa commented Oct 1, 2019

void list_remove(list_t *list, int index)
{
  int valid_index = list_inner_adjust_index(index, list_size(list));

  iterator_t *list_iterator(list);
  for (int i = 0; i < valid_index; ++i)
    {
      iterator_next(iter); 
    }

  iterator_remove(iter);

  iterator_delete(iter);
}

iterator_t *list_iterator(list); is wrong and should probably be iter_t *iter = list_iterator(list);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant