fix(convert/atoi): atoi was now working with NULL parameters
- Now fixed by the verification before
This commit is contained in:
parent
6255f5e0a3
commit
0988a2c8ab
1 changed files with 3 additions and 1 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/08 17:22:41 by rparodi #+# #+# */
|
||||
/* Updated: 2025/09/04 11:39:58 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/09/05 14:34:51 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -43,6 +43,8 @@ int ft_atoi(const char *nptr)
|
|||
int sign;
|
||||
int number;
|
||||
|
||||
if (!nptr)
|
||||
return (0);
|
||||
i = 0;
|
||||
sign = ft_check_sign(nptr, &i);
|
||||
number = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue