Corewar-Final/libft/libft/ft_strcmp.c
Jeremy FLEURY 748d10f4f3 push
2019-07-17 11:22:24 +02:00

27 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jfleury <jfleury@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/05 14:48:13 by jfleury #+# #+# */
/* Updated: 2019/03/04 14:38:51 by jfleury ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strcmp(const char *s1, const char *s2)
{
size_t i;
size_t j;
i = ft_strlen(s1);
j = ft_strlen(s2);
if (i > j)
return (ft_memcmp(s1, s2, i));
else
return (ft_memcmp(s1, s2, j));
}