fix(dll): ensure that we check that cur exists every loop iter

This commit is contained in:
Squibid 2025-09-06 02:17:14 -04:00
parent a3a9775c5f
commit 1a9b135f01
Signed by: squibid
GPG key ID: BECE5684D3C4005D

2
ds.c
View file

@ -132,7 +132,7 @@ void
return NULL; 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 (i + 1 == idx) {
if (idx == 0) { if (idx == 0) {
rm = cur; rm = cur;