-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_tolower.c
26 lines (23 loc) · 1.04 KB
/
ft_tolower.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tolower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mrios-es <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/13 19:05:12 by mrios-es #+# #+# */
/* Updated: 2023/09/13 19:05:12 by mrios-es ### ########.fr */
/* */
/* ************************************************************************** */
static int is_upper(char c)
{
return (c >= 'A' && c <= 'Z');
}
int ft_tolower(int c)
{
int offset;
offset = 'a' - 'A';
if (is_upper(c))
c += offset;
return (c);
}