don't crash when removing out of bounds

This commit is contained in:
2025-08-16 23:38:14 -04:00
parent db42c21754
commit 16470f2592
2 changed files with 10 additions and 1 deletions

1
test.c
View File

@@ -17,6 +17,7 @@ main(int argc, char *argv[])
ds_ll_foreach(ds_sll_t, ll) {
puts(cur->data);
}
ds_sll_remove(&ll, 1234);
char *pa = ds_sll_remove(&ll, 0); // [ "two" ]
char *pb = ds_sll_remove(&ll, 0); // [ ]