/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mazimi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2014/11/07 17:14:39 by mazimi #+# #+# */ /* Updated: 2014/12/02 16:00:19 by mazimi ### ########.fr */ /* */ /* ************************************************************************** */ #include "../libft.h" int ft_strcmp(const char *s1, const char *s2) { unsigned char s11; unsigned char s22; if (s1 == NULL && s2 == NULL) return (0); else if (s1 == NULL || s2 == NULL) return (-122); s11 = *s1; s22 = *s2; if (!s11 && !s22) return (0); else if (s11 != s22) return (s11 - s22); return (ft_strcmp(++s1, ++s2)); }