diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-02-06 00:28:25 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-06 00:28:25 +0100 |
| commit | 88f29720d2a09eaef81ad3646169d6bc19be8bfb (patch) | |
| tree | f7bcea07a8a7e4076c1817609c4a60d7e8213066 /functions_reference/ref_ft_list_push_front.c | |
| parent | 1ab2fedd108b26c9624454a897e2c518aaff7d32 (diff) | |
| download | libasm_test-88f29720d2a09eaef81ad3646169d6bc19be8bfb.tar.gz libasm_test-88f29720d2a09eaef81ad3646169d6bc19be8bfb.tar.bz2 libasm_test-88f29720d2a09eaef81ad3646169d6bc19be8bfb.zip | |
Added ft_list_size and ft_list_push_front test
Diffstat (limited to 'functions_reference/ref_ft_list_push_front.c')
| -rw-r--r-- | functions_reference/ref_ft_list_push_front.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/functions_reference/ref_ft_list_push_front.c b/functions_reference/ref_ft_list_push_front.c index 821247d..22ca4a9 100644 --- a/functions_reference/ref_ft_list_push_front.c +++ b/functions_reference/ref_ft_list_push_front.c @@ -3,9 +3,12 @@ void ref_ft_list_push_front(t_list **begin_list, void *data) { - - if (begin_list == NULL || data == NULL) + if (begin_list == NULL) + return ; + t_list *new = malloc(sizeof(t_list)); + if (new == NULL) return ; - data->next = *begin_list; - *begin_list = data; + new->data = data; + new->next = *begin_list; + *begin_list = new; } |
