1234567891011121314151617181920212223242526 |
- $OpenBSD: patch-wmgeneral_list_c,v 1.1.1.1 2000/11/18 13:53:32 naddy Exp $
- --- wmgeneral/list.c.orig Tue May 19 23:13:23 1998
- +++ wmgeneral/list.c Tue Oct 10 21:59:35 2000
- @@ -44,8 +44,11 @@ list_cons(void* head, LinkedList* tail)
- LinkedList* cell;
-
- cell = (LinkedList*)malloc(sizeof(LinkedList));
- - cell->head = head;
- - cell->tail = tail;
- + if (cell)
- + {
- + cell->head = head;
- + cell->tail = tail;
- + }
- return cell;
- }
-
- @@ -84,6 +87,7 @@ list_nth(int index, LinkedList* list)
- INLINE void
- list_remove_head(LinkedList** list)
- {
- + if (!list) return;
- if (!*list) return;
- if ((*list)->tail)
- {
|