diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-29 18:54:03 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-29 18:54:03 +0200 |
commit | dc7255fdb45587ddd90db87e3c3b971ebd8edef0 (patch) | |
tree | ffda6630195437ea771065d6d42f5fc84b35eea5 /libft/src | |
parent | Atoi update (diff) | |
download | 42-minishell-dc7255fdb45587ddd90db87e3c3b971ebd8edef0.tar.gz 42-minishell-dc7255fdb45587ddd90db87e3c3b971ebd8edef0.tar.bz2 42-minishell-dc7255fdb45587ddd90db87e3c3b971ebd8edef0.tar.xz 42-minishell-dc7255fdb45587ddd90db87e3c3b971ebd8edef0.tar.zst 42-minishell-dc7255fdb45587ddd90db87e3c3b971ebd8edef0.zip |
Some updates
Diffstat (limited to '')
-rw-r--r-- | libft/src/ft_atoi.c | 4 | ||||
-rw-r--r-- | libft/src/ft_bzero.c | 3 | ||||
-rw-r--r-- | libft/src/ft_calloc.c | 7 | ||||
-rw-r--r-- | libft/src/ft_delwords.c | 5 |
4 files changed, 9 insertions, 10 deletions
diff --git a/libft/src/ft_atoi.c b/libft/src/ft_atoi.c index 3640578..e0178db 100644 --- a/libft/src/ft_atoi.c +++ b/libft/src/ft_atoi.c @@ -25,7 +25,7 @@ static int8_t ft_setsign(const char c) return (sign); } -static uint8_t ft_seti(const char str[]) +static uint8_t ft_seti(const char *str) { uint8_t i; @@ -37,7 +37,7 @@ static uint8_t ft_seti(const char str[]) return (i); } -int ft_atoi(const char str[]) +int ft_atoi(const char *str) { uint8_t i; int8_t sign; diff --git a/libft/src/ft_bzero.c b/libft/src/ft_bzero.c index bec9e50..1d9ec9f 100644 --- a/libft/src/ft_bzero.c +++ b/libft/src/ft_bzero.c @@ -13,8 +13,7 @@ #include <libft.h> #include <stddef.h> -void - ft_bzero(void *s, size_t n) +void ft_bzero(void *s, size_t n) { ft_memset(s, 0, n); } diff --git a/libft/src/ft_calloc.c b/libft/src/ft_calloc.c index 88c5457..e8f81f7 100644 --- a/libft/src/ft_calloc.c +++ b/libft/src/ft_calloc.c @@ -14,15 +14,16 @@ #include <stddef.h> #include <stdlib.h> -void - *ft_calloc(size_t count, size_t size) +void *ft_calloc(size_t count, size_t size) { void *ptr; ptr = 0; ptr = malloc(count * size); - if (!ptr) + if (ptr == NULL) + { return (NULL); + } ft_bzero(ptr, count * size); return (ptr); } diff --git a/libft/src/ft_delwords.c b/libft/src/ft_delwords.c index 79c671d..ba952f7 100644 --- a/libft/src/ft_delwords.c +++ b/libft/src/ft_delwords.c @@ -13,13 +13,12 @@ #include <libft.h> #include <stddef.h> -void - ft_delwords(char **words) +void ft_delwords(char **words) { size_t i; i = 0; - while (words[i]) + while (words[i] != NULL) { ft_memdel((void*)&words[i]); i++; |