-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcmpi.c
23 lines (20 loc) · 1.08 KB
/
ft_strcmpi.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcmpi.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/02/14 11:35:35 by thifranc #+# #+# */
/* Updated: 2017/12/02 12:51:19 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strcmpi(const char *s1, const char *s2)
{
unsigned int i;
i = 0;
while (s1[i] && ft_tolower(s1[i]) == ft_tolower(s2[i]))
i++;
return ((unsigned char)s1[i] - (unsigned char)s2[i]);
}