forked from AingeruAlvarezSanchez/Libft
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_strcmp.c
34 lines (31 loc) · 1.16 KB
/
ft_strcmp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aalvarez <aalvarez@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/16 20:22:28 by becastro #+# #+# */
/* Updated: 2022/09/24 13:40:09 by aalvarez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief
* Str compare refactorized
* @param s1
* @param s2
* @return true
* @return false
*/
int ft_strcmp(char *s1, char *s2)
{
int i;
if (ft_strlen(s1) != ft_strlen(s2))
return (0);
i = -1;
while (s1[++i])
if (s1[i] != s2[i])
return (0);
return (1);
}