diff --git a/ft_atoi.c b/ft_atoi.c index 23fe9fc..85d4bb4 100644 --- a/ft_atoi.c +++ b/ft_atoi.c @@ -6,17 +6,17 @@ /* By: cchauvet = '0' && *str <= '9') || *str == '-' || *str == '+')) + if (i * sign > INT_MAX || INT_MIN > i * sign) return (0); + if (!(*str >= '0' && *str <= '9')) + return (0); + i = i * 10 + *str - '0'; str++; } return (1); diff --git a/ft_isnum.o b/ft_isnum.o deleted file mode 100644 index 194eec2..0000000 Binary files a/ft_isnum.o and /dev/null differ diff --git a/ft_p.o b/ft_p.o deleted file mode 100644 index ecaa99b..0000000 Binary files a/ft_p.o and /dev/null differ diff --git a/ft_putstr.o b/ft_putstr.o deleted file mode 100644 index 0412ac9..0000000 Binary files a/ft_putstr.o and /dev/null differ diff --git a/ft_r.o b/ft_r.o deleted file mode 100644 index acd1a9b..0000000 Binary files a/ft_r.o and /dev/null differ diff --git a/ft_radix.o b/ft_radix.o deleted file mode 100644 index 7a3bba8..0000000 Binary files a/ft_radix.o and /dev/null differ diff --git a/ft_rr.o b/ft_rr.o deleted file mode 100644 index d1f0dec..0000000 Binary files a/ft_rr.o and /dev/null differ diff --git a/ft_s.o b/ft_s.o deleted file mode 100644 index d3dc876..0000000 Binary files a/ft_s.o and /dev/null differ diff --git a/ft_sort.o b/ft_sort.o deleted file mode 100644 index a978d4c..0000000 Binary files a/ft_sort.o and /dev/null differ diff --git a/ft_split.o b/ft_split.o deleted file mode 100644 index cdd65ad..0000000 Binary files a/ft_split.o and /dev/null differ diff --git a/ft_strlen.o b/ft_strlen.o deleted file mode 100644 index 9738a9f..0000000 Binary files a/ft_strlen.o and /dev/null differ diff --git a/ft_swap.o b/ft_swap.o deleted file mode 100644 index 22b1580..0000000 Binary files a/ft_swap.o and /dev/null differ diff --git a/ft_tablen.o b/ft_tablen.o deleted file mode 100644 index ddd152e..0000000 Binary files a/ft_tablen.o and /dev/null differ diff --git a/main.c b/main.c index dcac79f..92cd4c3 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: cchauvet # include # include -//# include # define STOP_VALUE 4294967295 -int ft_isnum(char *str); -size_t ft_strlen(const char *s); -int ft_atoi(char *str); -void ft_putstr(char *str); -size_t ft_seglen(const char *s, char c); -char **ft_split(const char *s, char c); -void ft_cancel(char **str, size_t len); +int ft_isnum(char *str); +size_t ft_strlen(const char *s); +long int ft_atoi(char *str); +void ft_putstr(char *str); +size_t ft_seglen(const char *s, char c); +char **ft_split(const char *s, char c); +void ft_cancel(char **str, size_t len); -void ft_sort(long int *tab, int size); +void ft_sort(long int *tab, int size); -int ft_get_max_index(long int *tab, int size); +int ft_get_max_index(long int *tab, int size); int ft_get_max(unsigned int *tab); int ft_tablen(unsigned int *tab); int ft_is_sorted(unsigned int *in); unsigned int ft_bitlen(unsigned int nb); -void ft_radix_sort(unsigned int *tab_a, unsigned int *tab_b); -void ft_bozo_sort(unsigned int *tab_a, unsigned int *tab_b); -void ft_swap(unsigned int *a, unsigned int *b); -void ft_pa(unsigned int *tab_a, unsigned int *tab_b); -void ft_pb(unsigned int *tab_a, unsigned int *tab_b); -void ft_ra(unsigned int *tab_a); -void ft_rb(unsigned int *tab_b); -void ft_rra(unsigned int *tab_a); -void ft_rrb(unsigned int *tab_b); -void ft_sa(unsigned int *tab_a); +void ft_radix_sort(unsigned int *tab_a, unsigned int *tab_b); +void ft_bozo_sort(unsigned int *tab_a, unsigned int *tab_b); +void ft_swap(unsigned int *a, unsigned int *b); +void ft_pa(unsigned int *tab_a, unsigned int *tab_b); +void ft_pb(unsigned int *tab_a, unsigned int *tab_b); +void ft_ra(unsigned int *tab_a); +void ft_rb(unsigned int *tab_b); +void ft_rra(unsigned int *tab_a); +void ft_rrb(unsigned int *tab_b); +void ft_sa(unsigned int *tab_a); -typedef unsigned int * t_tab; +typedef unsigned int *t_tab; #endif