diff options
Diffstat (limited to 'libft')
| -rw-r--r-- | libft/include/libft.h | 2 | ||||
| -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 | 
5 files changed, 10 insertions, 11 deletions
| diff --git a/libft/include/libft.h b/libft/include/libft.h index 42cb73b..c0910b1 100644 --- a/libft/include/libft.h +++ b/libft/include/libft.h @@ -155,7 +155,7 @@ int						ft_toupper(int c);  int						ft_tolower(int c);  int						ft_strncmp(const char *s1, const char *s2, size_t n);  int						ft_lstsize(t_list *lst); -int						ft_atoi(const char str[]); +int						ft_atoi(const char *str);  int						ft_putchar(int c);  int						ft_putnchar(int c, const size_t n);  int						ft_putstr(const char *s); 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++; | 
