diff --git a/libft/src/char/ft_isalnum.c b/libft/src/char/ft_isalnum.c index 0b46b15e..673b6e89 100644 --- a/libft/src/char/ft_isalnum.c +++ b/libft/src/char/ft_isalnum.c @@ -1,13 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isalnum.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:56:18 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:31:33 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_isalnum(int c) { - unsigned char a; - - a = (unsigned char)c; - if ((a >= 'a' && a <= 'z') - || (a >= 'A' && a <= 'Z') - || (a >= '0' && a <= '9')) - return (a); + if ((c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9')) + return (c); return (0); } diff --git a/libft/src/char/ft_isalpha.c b/libft/src/char/ft_isalpha.c index 97d0ec43..29f532a9 100644 --- a/libft/src/char/ft_isalpha.c +++ b/libft/src/char/ft_isalpha.c @@ -1,11 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isalpha.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:56:24 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:32:00 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_isalpha(int c) { - unsigned char a; - - a = (unsigned char)c; - if ((a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z')) - return (a); + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) + return (c); return (0); } diff --git a/libft/src/char/ft_isascii.c b/libft/src/char/ft_isascii.c index d15a4ed8..52a85067 100644 --- a/libft/src/char/ft_isascii.c +++ b/libft/src/char/ft_isascii.c @@ -1,11 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isascii.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:56:28 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:35:42 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_isascii(int c) { - unsigned char a; - - a = (unsigned char)c; - if (a >= 0 && a <= 127) - return (a); + if (c >= 0 && c <= 127) + return (1); return (0); } diff --git a/libft/src/char/ft_isdigit.c b/libft/src/char/ft_isdigit.c index 8c811800..510371c2 100644 --- a/libft/src/char/ft_isdigit.c +++ b/libft/src/char/ft_isdigit.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:56:33 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:56:34 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_isdigit(int c) diff --git a/libft/src/char/ft_isprint.c b/libft/src/char/ft_isprint.c index 0dbed58e..74a46640 100644 --- a/libft/src/char/ft_isprint.c +++ b/libft/src/char/ft_isprint.c @@ -1,11 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isprint.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:56:38 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:32:40 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_isprint(int c) { - unsigned char a; - - a = (unsigned char)c; - if (a >= 32 && a <= 126) - return (a); + if (c >= 32 && c <= 126) + return (c); return (0); } diff --git a/libft/src/char/ft_tolower.c b/libft/src/char/ft_tolower.c index dd6751c8..3992c4c9 100644 --- a/libft/src/char/ft_tolower.c +++ b/libft/src/char/ft_tolower.c @@ -1,11 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_tolower.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:46 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:24:09 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" -int ft_toupper(int c) +int ft_tolower(int c) { - unsigned char a; - - a = (unsigned char)c; - if (a >= 'A' && a <= 'Z') - return (a + 32); - return (a); + if (c >= 'A' && c <= 'Z') + return (c + 32); + return (c); } diff --git a/libft/src/char/ft_toupper.c b/libft/src/char/ft_toupper.c index 08720bb6..3aa9ea10 100644 --- a/libft/src/char/ft_toupper.c +++ b/libft/src/char/ft_toupper.c @@ -1,11 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_toupper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:53:58 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:24:40 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_toupper(int c) { - unsigned char a; - - a = (unsigned char)c; - if (a >= 'a' && a <= 'z') - return (a - 32); - return (a); + if (c >= 'a' && c <= 'z') + return (c - 32); + return (c); } diff --git a/libft/src/lst/ft_lstadd.c b/libft/src/lst/ft_lstadd.c new file mode 100644 index 00000000..8ac0d1f3 --- /dev/null +++ b/libft/src/lst/ft_lstadd.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstadd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:13 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:13 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstadd(t_list **alst, t_list *new) +{ + if (new) + { + new->next = *alst; + *alst = new; + } +} diff --git a/libft/src/lst/ft_lstdel.c b/libft/src/lst/ft_lstdel.c new file mode 100644 index 00000000..b8056396 --- /dev/null +++ b/libft/src/lst/ft_lstdel.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstdel.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 15:18:57 by jhalford #+# #+# */ +/* Updated: 2016/11/03 16:40:21 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +void ft_lstdel(t_list **alst, void (*del)(void *, size_t)) +{ + if ((*alst)->next) + ft_lstdel(&(*alst)->next, del); + ft_lstdelone(&(*alst), del); +} diff --git a/libft/src/lst/ft_lstdelone.c b/libft/src/lst/ft_lstdelone.c index c1c26741..1aa876b5 100644 --- a/libft/src/lst/ft_lstdelone.c +++ b/libft/src/lst/ft_lstdelone.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstdelone.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:15 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:15:51 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_lstdelone(t_list **alst, void (*del)(void *, size_t)) diff --git a/libft/src/lst/ft_lsteadd.c b/libft/src/lst/ft_lsteadd.c index 9456158d..a6e89757 100644 --- a/libft/src/lst/ft_lsteadd.c +++ b/libft/src/lst/ft_lsteadd.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lsteadd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:17 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:18 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_lsteadd(t_list **alst, t_list *new) @@ -5,7 +17,6 @@ void ft_lsteadd(t_list **alst, t_list *new) t_list *lst; lst = *alst; - new->next = NULL; if (lst) { while (lst->next) diff --git a/libft/src/lst/ft_lstiter.c b/libft/src/lst/ft_lstiter.c index 0756d531..6bf86a06 100644 --- a/libft/src/lst/ft_lstiter.c +++ b/libft/src/lst/ft_lstiter.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:19 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:19 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_lstiter(t_list *lst, void (*f)(t_list *elem)) diff --git a/libft/src/lst/ft_lstmap.c b/libft/src/lst/ft_lstmap.c index 5d30a227..55f28530 100644 --- a/libft/src/lst/ft_lstmap.c +++ b/libft/src/lst/ft_lstmap.c @@ -1,6 +1,34 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstmap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:21 by jhalford #+# #+# */ +/* Updated: 2016/11/03 16:40:39 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" -t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem)) +static void ft_lsteadd(t_list **alst, t_list *new) +{ + t_list *lst; + + lst = *alst; + new->next = NULL; + if (lst) + { + while (lst->next) + lst = lst->next; + lst->next = new; + } + else + *alst = new; +} + +t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem)) { t_list *out; t_list *elem; @@ -9,8 +37,7 @@ t_list *ft_lstmap(t_list *lst, t_list *(*f)(t_list *elem)) while (lst) { elem = (*f)(lst); - if (elem) - elem = ft_lstnew(elem->content, elem->content_size); + elem = ft_lstnew(elem->content, elem->content_size); ft_lsteadd(&out, elem); lst = lst->next; } diff --git a/libft/src/lst/ft_lstnew.c b/libft/src/lst/ft_lstnew.c index fee8bc78..1ad8c10a 100644 --- a/libft/src/lst/ft_lstnew.c +++ b/libft/src/lst/ft_lstnew.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:24 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:24 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" t_list *ft_lstnew(void const *content, size_t content_size) diff --git a/libft/src/math/ft_itoa.c b/libft/src/math/ft_itoa.c index 657759e1..94a83c8f 100644 --- a/libft/src/math/ft_itoa.c +++ b/libft/src/math/ft_itoa.c @@ -1,5 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_itoa.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:10 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:27:16 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" +static char *ft_strrev(char *str) +{ + int len; + char tmp; + int i; + + i = 0; + len = 0; + while (str[len] != '\0') + len++; + while (i < len / 2) + { + tmp = str[len - (i + 1)]; + str[len - (i + 1)] = str[i]; + str[i] = tmp; + i++; + } + return (str); +} + static size_t ft_size(int n) { size_t i; @@ -10,13 +42,15 @@ static size_t ft_size(int n) return (i); } -char *ft_itoa(int n) +char *ft_itoa(int n) { int i; char *str; + int neg; i = 0; str = ft_strnew(ft_size(n) + 1); + neg = FT_NEG(n) ? 1 : 0; if (n == 0) { str[i++] = '0'; @@ -28,7 +62,7 @@ char *ft_itoa(int n) str[i++] = FT_ABS(n % 10) + '0'; n /= 10; } - if (FT_NEG(n)) + if (neg) str[i++] = '-'; str[i] = '\0'; return (ft_strrev(str)); diff --git a/libft/src/mem/ft_bzero.c b/libft/src/mem/ft_bzero.c index 77087ab0..6f1834b5 100644 --- a/libft/src/mem/ft_bzero.c +++ b/libft/src/mem/ft_bzero.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_bzero.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:56:08 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:56:09 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_bzero(void *s, size_t n) diff --git a/libft/src/mem/ft_memalloc.c b/libft/src/mem/ft_memalloc.c index ac781aec..a94572ed 100644 --- a/libft/src/mem/ft_memalloc.c +++ b/libft/src/mem/ft_memalloc.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memalloc.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:25 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:25 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void *ft_memalloc(size_t size) diff --git a/libft/src/mem/ft_memccpy.c b/libft/src/mem/ft_memccpy.c index 7db03485..699c2836 100644 --- a/libft/src/mem/ft_memccpy.c +++ b/libft/src/mem/ft_memccpy.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memccpy.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:26 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:36:05 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void *ft_memccpy(void *dst, const void *src, int c, size_t n) @@ -8,7 +20,7 @@ void *ft_memccpy(void *dst, const void *src, int c, size_t n) while (++i < n) { *(char *)dst++ = *(char *)src; - if (*(char *)src++ == (unsigned char)c) + if (*(char *)src++ == c) return (dst); } return (NULL); diff --git a/libft/src/mem/ft_memchr.c b/libft/src/mem/ft_memchr.c index 7b11d343..47eccf3b 100644 --- a/libft/src/mem/ft_memchr.c +++ b/libft/src/mem/ft_memchr.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:28 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:29 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void *ft_memchr(const void *s, int c, size_t n) diff --git a/libft/src/mem/ft_memcmp.c b/libft/src/mem/ft_memcmp.c index e09ad1a5..9dd827ee 100644 --- a/libft/src/mem/ft_memcmp.c +++ b/libft/src/mem/ft_memcmp.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memcmp.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:30 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:44:21 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_memcmp(const void *s1, const void *s2, size_t n) @@ -5,10 +17,10 @@ int ft_memcmp(const void *s1, const void *s2, size_t n) size_t i; int cmp; - i = 0; + i = -1; while (++i < n) { - cmp = ((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]; + cmp = *(unsigned char *)s1++ - *(unsigned char *)s2++; if (cmp) return (cmp); } diff --git a/libft/src/mem/ft_memcpy.c b/libft/src/mem/ft_memcpy.c index c4ee7141..a0711c68 100644 --- a/libft/src/mem/ft_memcpy.c +++ b/libft/src/mem/ft_memcpy.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memcpy.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:31 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:32 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void *ft_memcpy(void *dst, const void *src, size_t n) diff --git a/libft/src/mem/ft_memdel.c b/libft/src/mem/ft_memdel.c index 284d0534..7745391e 100644 --- a/libft/src/mem/ft_memdel.c +++ b/libft/src/mem/ft_memdel.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memdel.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:33 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:33 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_memdel(void **ap) diff --git a/libft/src/mem/ft_memmove.c b/libft/src/mem/ft_memmove.c index 1d13ed2a..952faa3d 100644 --- a/libft/src/mem/ft_memmove.c +++ b/libft/src/mem/ft_memmove.c @@ -1,14 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memmove.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:34 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:53:48 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void *ft_memmove(void *dst, const void *src, size_t len) { + char *srcc; + char *dstc; size_t i; - i = 0; - while (i < len && (dst + i < src || dst + i > src + len)) - { - ((char *)dst)[i] = ((char *)src)[i]; - i++; - } + i = -1; + srcc = (char *)src; + dstc = (char *)dst; + if (srcc < dstc) + while ((int)(--len) >= 0) + *(dstc + len) = *(srcc + len); + else + while (++i < len) + *(dstc + i) = *(srcc + i); return (dst); } diff --git a/libft/src/mem/ft_memset.c b/libft/src/mem/ft_memset.c index fdcf39af..cae3e999 100644 --- a/libft/src/mem/ft_memset.c +++ b/libft/src/mem/ft_memset.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memset.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:36 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:36 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void *ft_memset(void *b, int c, size_t len) diff --git a/libft/src/printing/ft_putchar.c b/libft/src/printing/ft_putchar.c index 8336fc99..bd6d350a 100644 --- a/libft/src/printing/ft_putchar.c +++ b/libft/src/printing/ft_putchar.c @@ -1,7 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putchar.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:37 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:38 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" -int ft_putchar(int c) +void ft_putchar(char c) { write(1, &c, 1); - return (0); } diff --git a/libft/src/printing/ft_putchar_fd.c b/libft/src/printing/ft_putchar_fd.c index 094ebd83..1d1e9a4b 100644 --- a/libft/src/printing/ft_putchar_fd.c +++ b/libft/src/printing/ft_putchar_fd.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putchar_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:39 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:39 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_putchar_fd(char c, int fd) diff --git a/libft/src/printing/ft_putendl.c b/libft/src/printing/ft_putendl.c index 43aad0f0..a0fc0b6b 100644 --- a/libft/src/printing/ft_putendl.c +++ b/libft/src/printing/ft_putendl.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putendl.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:40 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:41 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_putendl(char const *s) diff --git a/libft/src/printing/ft_putendl_fd.c b/libft/src/printing/ft_putendl_fd.c index 34dea4eb..9b33674c 100644 --- a/libft/src/printing/ft_putendl_fd.c +++ b/libft/src/printing/ft_putendl_fd.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putendl_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:42 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:42 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_putendl_fd(char const *s, int fd) diff --git a/libft/src/printing/ft_putstr_fd.c b/libft/src/printing/ft_putstr_fd.c index 6c0ad5c4..ee82000f 100644 --- a/libft/src/printing/ft_putstr_fd.c +++ b/libft/src/printing/ft_putstr_fd.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putstr_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:48 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:49 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_putstr_fd(char const *s, int fd) diff --git a/libft/src/str/ft_atoi.c b/libft/src/str/ft_atoi.c index 6fa0bf00..711e3d68 100644 --- a/libft/src/str/ft_atoi.c +++ b/libft/src/str/ft_atoi.c @@ -6,9 +6,11 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/03 16:17:21 by jhalford #+# #+# */ -/* Updated: 2016/08/07 18:10:10 by jhalford ### ########.fr */ +/* Updated: 2016/11/03 15:13:04 by jhalford ### ########.fr */ /* */ -/* ************************************************************************** */ +/* ************************************************************************** */ + +#include "libft.h" static int ft_iswhitespace(char c) { diff --git a/libft/src/str/ft_strcat.c b/libft/src/str/ft_strcat.c index aa52141a..b2947ea8 100644 --- a/libft/src/str/ft_strcat.c +++ b/libft/src/str/ft_strcat.c @@ -19,7 +19,7 @@ char *ft_strcat(char *s1, const char *s2) size = ft_strlen(s1); j = 0; - while (s2 && s2[j] != '\0') + while (s2[j] != '\0') { s1[size + j] = s2[j]; j++; diff --git a/libft/src/str/ft_strchr.c b/libft/src/str/ft_strchr.c index 514a8970..7263e413 100644 --- a/libft/src/str/ft_strchr.c +++ b/libft/src/str/ft_strchr.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:53 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:07:30 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strchr(const char *s, int c) diff --git a/libft/src/str/ft_strclr.c b/libft/src/str/ft_strclr.c index 8e3c38b2..834eb6f1 100644 --- a/libft/src/str/ft_strclr.c +++ b/libft/src/str/ft_strclr.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strclr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:57:54 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:57:55 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_strclr(char *s) diff --git a/libft/src/str/ft_strcmp.c b/libft/src/str/ft_strcmp.c index 4ed571dc..641bc5b8 100644 --- a/libft/src/str/ft_strcmp.c +++ b/libft/src/str/ft_strcmp.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:49:02 by jhalford #+# #+# */ -/* Updated: 2016/08/25 17:06:34 by jhalford ### ########.fr */ +/* Updated: 2016/11/03 16:08:51 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,18 +14,10 @@ int ft_strcmp(const char *s1, const char *s2) { - int cmp; - int i; + int i; i = 0; - while (1) - { - cmp = (s1[i] - s2[i]); - if (s1[i] == '\0' && s2[i] == '\0') - return (cmp); - if (s1[i] == s2[i]) - i++; - else - return (cmp); - } + while (*(s1 + i) && *(s1 + i) == *(s2 + i)) + i++; + return (*((unsigned char*)s1 + i) - *((unsigned char*)s2 + i)); } diff --git a/libft/src/str/ft_strdel.c b/libft/src/str/ft_strdel.c index fe2d29a5..a434df20 100644 --- a/libft/src/str/ft_strdel.c +++ b/libft/src/str/ft_strdel.c @@ -1,8 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strdel.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:00 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:00 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_strdel(char **as) { - if (as) - free(*as); + free(*as); *as = NULL; } diff --git a/libft/src/str/ft_strdup.c b/libft/src/str/ft_strdup.c index 5a2e196b..9233b26e 100644 --- a/libft/src/str/ft_strdup.c +++ b/libft/src/str/ft_strdup.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strdup.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:01 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:02 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strdup(const char *s1) diff --git a/libft/src/str/ft_strequ.c b/libft/src/str/ft_strequ.c index 25412e50..88e5580c 100644 --- a/libft/src/str/ft_strequ.c +++ b/libft/src/str/ft_strequ.c @@ -1,6 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strequ.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:04 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:02:10 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_strequ(char const *s1, char const *s2) { - return(ft_strcmp(s1, s2) == 0); + return (ft_strcmp(s1, s2) == 0); } diff --git a/libft/src/str/ft_striter.c b/libft/src/str/ft_striter.c index e1feafaf..8c309549 100644 --- a/libft/src/str/ft_striter.c +++ b/libft/src/str/ft_striter.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_striter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:13 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:13 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_striter(char *s, void (*f)(char *)) diff --git a/libft/src/str/ft_striteri.c b/libft/src/str/ft_striteri.c index 58773ac3..80cdd8b5 100644 --- a/libft/src/str/ft_striteri.c +++ b/libft/src/str/ft_striteri.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_striteri.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:15 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:15 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" void ft_striteri(char *s, void (*f)(unsigned int, char *)) diff --git a/libft/src/str/ft_strjoin.c b/libft/src/str/ft_strjoin.c index 507fba7f..58a57d14 100644 --- a/libft/src/str/ft_strjoin.c +++ b/libft/src/str/ft_strjoin.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strjoin.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:18 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:18 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strjoin(char const *s1, char const *s2) diff --git a/libft/src/str/ft_strlen.c b/libft/src/str/ft_strlen.c index cf3f6c5a..4075825e 100644 --- a/libft/src/str/ft_strlen.c +++ b/libft/src/str/ft_strlen.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:22 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:23 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" size_t ft_strlen(const char *s) diff --git a/libft/src/str/ft_strmap.c b/libft/src/str/ft_strmap.c index b0a115e7..295214f0 100644 --- a/libft/src/str/ft_strmap.c +++ b/libft/src/str/ft_strmap.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strmap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:24 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:25 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strmap(char const *s, char (*f)(char)) diff --git a/libft/src/str/ft_strmapi.c b/libft/src/str/ft_strmapi.c index b3b583c2..0d6fab4c 100644 --- a/libft/src/str/ft_strmapi.c +++ b/libft/src/str/ft_strmapi.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strmapi.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:28 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:29 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strmapi(char const *s, char (*f)(unsigned int, char)) diff --git a/libft/src/str/ft_strncat.c b/libft/src/str/ft_strncat.c index e5d7c040..31ab2262 100644 --- a/libft/src/str/ft_strncat.c +++ b/libft/src/str/ft_strncat.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:57:07 by jhalford #+# #+# */ -/* Updated: 2016/08/07 10:57:11 by jhalford ### ########.fr */ +/* Updated: 2016/11/03 15:02:27 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,7 @@ char *ft_strncat(char *s1, const char *s2, size_t n) { - size_t size;; + size_t size; size_t j; size = ft_strlen(s1); diff --git a/libft/src/str/ft_strncmp.c b/libft/src/str/ft_strncmp.c index cd7b8534..57b55b5f 100644 --- a/libft/src/str/ft_strncmp.c +++ b/libft/src/str/ft_strncmp.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:49:12 by jhalford #+# #+# */ -/* Updated: 2016/08/15 22:25:07 by jhalford ### ########.fr */ +/* Updated: 2016/11/03 16:11:00 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,20 +14,13 @@ int ft_strncmp(const char *s1, const char *s2, size_t n) { - int cmp; - size_t i; + int i; i = 0; - while (1) - { - cmp = (s1[i] - s2[i]); - if (i >= n - 1) - return (cmp); - if (s1[i] == '\0' && s2[i] == '\0') - return (cmp); - if (s1[i] == s2[i]) - i++; - else - return (cmp); - } + while (*(s1 + i) && *(s1 + i) == *(s2 + i) && i < (int)n) + i++; + if (i < (int)n) + return (*((unsigned char*)s1 + i) - *((unsigned char*)s2 + i)); + else + return (0); } diff --git a/libft/src/str/ft_strnequ.c b/libft/src/str/ft_strnequ.c index 8b3b3a06..5dfd6005 100644 --- a/libft/src/str/ft_strnequ.c +++ b/libft/src/str/ft_strnequ.c @@ -1,6 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strnequ.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:32 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:02:36 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" int ft_strnequ(char const *s1, char const *s2, size_t n) { - return(ft_strncmp(s1, s2, n) == 0); + return (ft_strncmp(s1, s2, n) == 0); } diff --git a/libft/src/str/ft_strnew.c b/libft/src/str/ft_strnew.c index 21bc4ba7..4a60408f 100644 --- a/libft/src/str/ft_strnew.c +++ b/libft/src/str/ft_strnew.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:34 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:35 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strnew(size_t size) diff --git a/libft/src/str/ft_strnstr.c b/libft/src/str/ft_strnstr.c index 554efb08..efa7e54f 100644 --- a/libft/src/str/ft_strnstr.c +++ b/libft/src/str/ft_strnstr.c @@ -1,23 +1,34 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strnstr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:36 by jhalford #+# #+# */ +/* Updated: 2016/11/03 16:34:42 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strnstr(const char *big, const char *little, size_t len) { size_t i; - size_t j; - char *a; + int j; - a = (char *)big; - i = 0; - while (a[i] != '\0' && i < len) + i = -1; + if (!*little) + return ((char *)big); + while (big[++i] && i < len) { j = 0; - while (a[i + j] == little[j]) + while (big[i + j] == little[j] && i + j < len) { j++; - if (little[j] == '\0') - return (a + i); + if (!little[j]) + return ((char *)big + i); } - i++; } return (NULL); } diff --git a/libft/src/str/ft_strrchr.c b/libft/src/str/ft_strrchr.c index f3d77baa..e41d4566 100644 --- a/libft/src/str/ft_strrchr.c +++ b/libft/src/str/ft_strrchr.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strrchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:38 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:08:33 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strrchr(const char *s, int c) diff --git a/libft/src/str/ft_strsplit.c b/libft/src/str/ft_strsplit.c index bcb0b09c..d5d3496b 100644 --- a/libft/src/str/ft_strsplit.c +++ b/libft/src/str/ft_strsplit.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strsplit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:40 by jhalford #+# #+# */ +/* Updated: 2016/11/03 15:00:19 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" static char **alloc_table(char **table, const char *str, char c) @@ -81,12 +93,10 @@ static char **fill_table(char **table, const char *str, char c) return (table); } -char **ft_strsplit(char const *s, char c) +char **ft_strsplit(char const *s, char c) { char **table; - if (!s) - return (NULL); table = 0; table = alloc_table(table, s, c); table = alloc_words(table, s, c); diff --git a/libft/src/str/ft_strstr.c b/libft/src/str/ft_strstr.c index 2fa6496c..bf8ab37a 100644 --- a/libft/src/str/ft_strstr.c +++ b/libft/src/str/ft_strstr.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:48:35 by jhalford #+# #+# */ -/* Updated: 2016/08/09 13:53:17 by jhalford ### ########.fr */ +/* Updated: 2016/11/03 16:28:05 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,22 +14,24 @@ char *ft_strstr(const char *big, const char *little) { - size_t i; - size_t j; + int i; + int j; char *a; a = (char *)big; i = 0; - while (a[i] != '\0') + if (!*little) + return (a); + while (a[i]) { j = 0; while (a[i + j] == little[j]) { j++; - if (little[j] == '\0') + if (!little[j]) return (a + i); } i++; } - return (0); + return (NULL); } diff --git a/libft/src/str/ft_strsub.c b/libft/src/str/ft_strsub.c index 6c5eea09..bf883507 100644 --- a/libft/src/str/ft_strsub.c +++ b/libft/src/str/ft_strsub.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strsub.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:43 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:43 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strsub(char const *s, unsigned int start, size_t len) diff --git a/libft/src/str/ft_strtrim.c b/libft/src/str/ft_strtrim.c index b607dbef..0ea9dd0b 100644 --- a/libft/src/str/ft_strtrim.c +++ b/libft/src/str/ft_strtrim.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strtrim.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: jhalford +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2016/11/03 14:58:45 by jhalford #+# #+# */ +/* Updated: 2016/11/03 14:58:45 by jhalford ### ########.fr */ +/* */ +/* ************************************************************************** */ + #include "libft.h" char *ft_strtrim(char const *s)