View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0009635 | GNUnet | util library | public | 2025-03-18 14:48 | 2025-03-20 19:43 |
Reporter | fefe | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Target Version | 0.24.1 | ||||
Summary | 0009635: question about linked lists | ||||
Description | 1916 #define GNUNET_CONTAINER_DLL_remove(head, tail, element) \ 1917 do \ 1918 { \ 1919 GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \ 1920 GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \ 1921 if ((element)->prev == NULL) \ 1922 (head) = (element)->next; \ 1923 else \ 1924 (element)->prev->next = (element)->next; \ 1925 if ((element)->next == NULL) \ 1926 (tail) = (element)->prev; \ 1927 else \ 1928 (element)->next->prev = (element)->prev; \ 1929 (element)->next = NULL; \ 1930 (element)->prev = NULL; \ 1931 } while (0) If you remove the last element in the list, head and tail are left pointing to the removed element. Isn't that a problem? | ||||
Tags | No tags attached. | ||||