diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2012-02-20 22:40:37 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2012-02-20 22:40:37 +0000 |
commit | f1b7646949ea36d133538d21c58d15d2918b7b26 (patch) | |
tree | 535fed3e1d67531abc97038375e4d4c1aafd72cc /src/utils/list.h | |
parent | f7cd77bbe4ba311556d7a482b1d03af3b74f8361 (diff) | |
download | libdom-f1b7646949ea36d133538d21c58d15d2918b7b26.tar.gz libdom-f1b7646949ea36d133538d21c58d15d2918b7b26.tar.bz2 |
Fix blatent brokenness
svn path=/trunk/libdom/; revision=13456
Diffstat (limited to 'src/utils/list.h')
-rw-r--r-- | src/utils/list.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/utils/list.h b/src/utils/list.h index 6e3ba20..710c520 100644 --- a/src/utils/list.h +++ b/src/utils/list.h @@ -40,7 +40,8 @@ static inline void list_append(struct list_entry *head, struct list_entry *new) { new->next = head; new->prev = head->prev; - head->prev->next = new; + if (head->prev != NULL) + head->prev->next = new; head->prev = new; } @@ -51,8 +52,10 @@ static inline void list_append(struct list_entry *head, struct list_entry *new) */ static inline void list_del(struct list_entry *ent) { - ent->prev->next = ent->next; - ent->next->prev = ent->prev; + if (ent->prev != NULL) + ent->prev->next = ent->next; + if (ent->next != NULL) + ent->next->prev = ent->prev; ent->prev = ent; ent->next = ent; |