diff options
Diffstat (limited to 'ft_strcmp.c')
| -rw-r--r-- | ft_strcmp.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ft_strcmp.c b/ft_strcmp.c index df1a2e2..1978286 100644 --- a/ft_strcmp.c +++ b/ft_strcmp.c @@ -6,16 +6,13 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 10:16:07 by cacharle #+# #+# */ -/* Updated: 2019/10/07 10:16:19 by cacharle ### ########.fr */ +/* Updated: 2019/11/21 01:58:27 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ +#include "libft.h" + int ft_strcmp(const char *s1, const char *s2) { - int i; - - i = 0; - while (s1[i] && s2[i] && s1[i] == s2[i]) - i++; - return ((unsigned char)s1[i] - (unsigned char)s2[i]); + return (ft_memcmp(s1, s2, ft_strlen(s1) + 1)); } |
