diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-12-01 21:35:53 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-12-01 21:35:53 +0100 |
commit | 314f8f2c501322717c247fe512093a894244b702 (patch) | |
tree | 7542a204ffd719f639624f33cfa079063fc98e8c /libft | |
parent | commit (diff) | |
download | 42-minishell-314f8f2c501322717c247fe512093a894244b702.tar.gz 42-minishell-314f8f2c501322717c247fe512093a894244b702.tar.bz2 42-minishell-314f8f2c501322717c247fe512093a894244b702.tar.xz 42-minishell-314f8f2c501322717c247fe512093a894244b702.tar.zst 42-minishell-314f8f2c501322717c247fe512093a894244b702.zip |
Merged shotgunfixes
Diffstat (limited to 'libft')
-rw-r--r-- | libft/Makefile | 1 | ||||
-rw-r--r-- | libft/include/libft.h | 1 | ||||
-rw-r--r-- | libft/src/ft_isfulldigit.c | 23 |
3 files changed, 25 insertions, 0 deletions
diff --git a/libft/Makefile b/libft/Makefile index 4024b3e..66b8081 100644 --- a/libft/Makefile +++ b/libft/Makefile @@ -28,6 +28,7 @@ SRCS_NAME += ft_strclen.c SRCS_NAME += ft_strnlen.c SRCS_NAME += ft_isalpha.c SRCS_NAME += ft_isdigit.c +SRCS_NAME += ft_isfulldigit.c SRCS_NAME += ft_isalnum.c SRCS_NAME += ft_isascii.c SRCS_NAME += ft_isprint.c diff --git a/libft/include/libft.h b/libft/include/libft.h index 47992c0..265d87c 100644 --- a/libft/include/libft.h +++ b/libft/include/libft.h @@ -145,6 +145,7 @@ int ft_memcmp(const void *s1, const void *s2, size_t n); t_bool ft_isspace(int c); t_bool ft_iswhitespace(int c); t_bool ft_ischarset(const char *charset, int c); +t_bool ft_isfulldigit(char *str); t_bool ft_isupper(int c); t_bool ft_islower(int c); t_bool ft_isalpha(int c); diff --git a/libft/src/ft_isfulldigit.c b/libft/src/ft_isfulldigit.c new file mode 100644 index 0000000..d7b7d1e --- /dev/null +++ b/libft/src/ft_isfulldigit.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:06:39 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:06:39 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> + +t_bool ft_isfulldigit(char *str) +{ + unsigned int i; + + i = 0; + while (ft_isdigit(str[i])) + i++; + return (i == ft_strlen(str)); +} |