From fbc52949004a067a5c2cfefae1ff3415dbe04a96 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Sat, 15 Feb 2020 18:51:30 +0100 Subject: In progress --- src/ft_check_ext.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/ft_check_ext.c (limited to 'src/ft_check_ext.c') diff --git a/src/ft_check_ext.c b/src/ft_check_ext.c new file mode 100644 index 0000000..f4a1e92 --- /dev/null +++ b/src/ft_check_ext.c @@ -0,0 +1,13 @@ +#include +#include + +int8_t + ft_check_ext(const char *filep, const char *ext) +{ + const uint8_t extlen = ft_strlen(ext); + + if (ft_strncmp(filep + (ft_strlen(filep) - extlen), ext, extlen)) + return (-1); + else + return (0); +} -- cgit v1.2.3 From e40442466e3f20f83a2d7755a6038bc3fc27fa8e Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Mon, 17 Feb 2020 15:36:49 +0100 Subject: Norme --- src/ft_check_ext.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ft_check_ext.c') diff --git a/src/ft_check_ext.c b/src/ft_check_ext.c index f4a1e92..9a953d0 100644 --- a/src/ft_check_ext.c +++ b/src/ft_check_ext.c @@ -1,3 +1,15 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_check_ext.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/17 15:33:28 by rbousset #+# #+# */ +/* Updated: 2020/02/17 15:33:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + #include #include -- cgit v1.2.3