A lot of edit but adding the struct (Yes, i just use parameters of the function util now, See u morrow)

This commit is contained in:
Raphaël 2024-04-01 01:55:59 +02:00
parent 9c4dfafdf7
commit 56655f5426
15 changed files with 403 additions and 30 deletions

View file

@ -1,12 +1,12 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncmp.c :+: :+: :+: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 16:56:56 by rparodi #+# #+# */
/* Updated: 2024/03/31 19:51:17 by rparodi ### ########.fr */
/* Updated: 2024/03/31 21:57:48 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -20,7 +20,7 @@ int ft_strcmp(const char *s1, const char *s2)
i = 0;
while ((s1[i] || s2[i]))
{
if (s1[i] != s2[i])
if (s1[i] != s2[i] && s1 && s2)
{
diff = (unsigned char)s1[i] - (unsigned char)s2[i];
return (diff);