fix(dll): ensure that we check that cur exists every loop iter
This commit is contained in:
parent
a3a9775c5f
commit
1a9b135f01
1 changed files with 1 additions and 1 deletions
2
ds.c
2
ds.c
|
|
@ -132,7 +132,7 @@ void
|
|||
return NULL;
|
||||
}
|
||||
|
||||
for (i = -1, cur = *ll;; i++, cur = cur->next) {
|
||||
for (i = -1, cur = *ll; cur; i++, cur = cur->next) {
|
||||
if (i + 1 == idx) {
|
||||
if (idx == 0) {
|
||||
rm = cur;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue