-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcasecmp.c
24 lines (21 loc) · 1.09 KB
/
ft_strcasecmp.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcasecmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tairribe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/04 20:09:58 by tairribe #+# #+# */
/* Updated: 2023/10/04 20:13:08 by tairribe ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strcasecmp(char *s1, char *s2)
{
int i;
i = 0;
while ((s1[i] != '\0') && (s2[i] != '\0')
&& (ft_tolower(s1[i]) == ft_tolower(s2[i])))
i++;
return (ft_tolower(s1[i]) - ft_tolower(s2[i]));
}