patch-wmgeneral_list_c 634 B

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