From d57bcf69587122a01c29a7812278072287e551f1 Mon Sep 17 00:00:00 2001 From: Anahit Sargsyan Date: Sun, 3 Dec 2023 18:21:17 +0400 Subject: [PATCH] changed the check for negative numbers --- ex00/ft_utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ex00/ft_utils.c b/ex00/ft_utils.c index c0e3e67..a23aadf 100644 --- a/ex00/ft_utils.c +++ b/ex00/ft_utils.c @@ -6,7 +6,7 @@ /* By: achubuko +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/02 21:56:30 by achubuko #+# #+# */ -/* Updated: 2023/12/03 18:07:15 by achubuko ### ########.fr */ +/* Updated: 2023/12/03 18:14:54 by asargsya ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_utils.h" @@ -33,13 +33,13 @@ int ft_str_is_numeric(char *str) i = 0; if (str[i] == '\0') return (0); + if (str[i] == '-') + return (-1); while (str[i] != '\0') { if (str[i] < '0' || str[i] > '9') return (0); i++; } - if (str[0] == '-') - return (-1); return (1); }