segfaults have been eliminated
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2018/04/07 12:47:06 by tmaze #+# #+# #
|
||||
# Updated: 2019/04/22 12:11:07 by mndhlovu ### ########.fr #
|
||||
# Updated: 2019/04/26 11:54:46 by mndhlovu ### ########.fr #
|
||||
# #
|
||||
#******************************************************************************#
|
||||
|
||||
@@ -32,6 +32,7 @@ SRCS = ft_memalloc.c \
|
||||
ft_isascii.c \
|
||||
ft_isprint.c \
|
||||
ft_toupper.c \
|
||||
ft_isnumeric.c \
|
||||
ft_tolower.c \
|
||||
ft_isupper.c \
|
||||
ft_islower.c \
|
||||
|
@@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/08 00:12:36 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/20 16:46:41 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/04/26 10:36:51 by mndhlovu ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -266,6 +266,7 @@ int ft_strncmp(const char *s1, const char *s2, size_t n);
|
||||
int ft_atoi(const char *str);
|
||||
int ft_isalpha(int c);
|
||||
int ft_isdigit(int c);
|
||||
int ft_isnumeric(char *str);
|
||||
int ft_isalnum(int c);
|
||||
int ft_isascii(int c);
|
||||
int ft_isprint(int c);
|
||||
|
27
libft/srcs/ft_isnumeric.c
Normal file
27
libft/srcs/ft_isnumeric.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isnumeric.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mndhlovu <mndhlovu@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/26 10:17:04 by mndhlovu #+# #+# */
|
||||
/* Updated: 2019/04/26 10:35:46 by mndhlovu ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_isnumeric(char *str)
|
||||
{
|
||||
int index;
|
||||
|
||||
index = 0;
|
||||
while (str[index] != '\0')
|
||||
{
|
||||
if (!ft_isdigit(str[index]))
|
||||
return (0);
|
||||
index++;
|
||||
}
|
||||
return (1);
|
||||
}
|
Reference in New Issue
Block a user