ft_strcapitalize.c

This commit is contained in:
Timo Schmidt 2023-03-19 11:48:21 +01:00
parent c41701f2d9
commit ea50fc0232
1 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */ /* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 11:27:43 by tischmid #+# #+# */ /* Created: 2023/03/19 11:27:43 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:44:36 by tischmid ### ########.fr */ /* Updated: 2023/03/19 11:48:17 by tischmid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -23,8 +23,8 @@ char *ft_strcapitalize(char *str)
while (str[++i] != '\0') while (str[++i] != '\0')
{ {
c = str[i]; c = str[i];
is_alpha = (c | 32) >= 'a' && (c | 32) <= 'z'; is_alpha = ((c | 32) >= 'a' && (c | 32) <= 'z');
is_numeric = c >= '0' && c <= '9'; is_numeric = (c >= '0' && c <= '9');
if (!inside_word && (is_alpha || is_numeric)) if (!inside_word && (is_alpha || is_numeric))
{ {
inside_word = 1; inside_word = 1;