diff options
author | Michael Cardell Widerkrantz <mc@hack.org> | 2010-11-01 21:30:32 +0100 |
---|---|---|
committer | Michael Cardell Widerkrantz <mc@hack.org> | 2010-11-01 21:30:32 +0100 |
commit | 72dabe9f72f26bda476ecf2f226d475099fe7824 (patch) | |
tree | 7de03b78dfecaed820d5337420710d7cb2f5842f | |
parent | da1e8d8099a54a0f49791af5e2baa234ed88278c (diff) | |
download | mcwm-72dabe9f72f26bda476ecf2f226d475099fe7824.zip |
Checking for NULLs.
-rw-r--r-- | list.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -13,6 +13,11 @@ void movetohead(struct item **mainlist, struct item *item) { + if (NULL == item || NULL == mainlist || NULL == *mainlist) + { + return; + } + if (*mainlist == item) { /* Already at head. Do nothing. */ @@ -74,7 +79,7 @@ void delitem(struct item **mainlist, struct item *item) { struct item *ml = *mainlist; - if (NULL == mainlist) + if (NULL == mainlist || NULL == *mainlist || NULL == item) { return; } |