/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:49:02 by jhalford #+# #+# */ /* Updated: 2016/11/03 19:13:48 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" int ft_strcmp(const char *s1, const char *s2) { int i; i = 0; if (!s1 || !s2) return (0); while (*(s1 + i) && *(s1 + i) == *(s2 + i)) i++; return (*((unsigned char*)s1 + i) - *((unsigned char*)s2 + i)); }