27 lines
1.1 KiB
C
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));
|
|
}
|