norm: fixed all the norme issues in the perform_color_checks() function

This commit is contained in:
Theo Champion 2025-07-22 12:12:07 +02:00
parent c495547a70
commit 4b2f671107

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/21 19:35:43 by tchampio #+# #+# */ /* Created: 2025/06/21 19:35:43 by tchampio #+# #+# */
/* Updated: 2025/07/21 15:28:36 by kcolin ### ########.fr */ /* Updated: 2025/07/22 12:11:28 by tchampio ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -16,14 +16,15 @@
bool perform_color_checks(int *color, char *strcolor, t_mapdata *map) bool perform_color_checks(int *color, char *strcolor, t_mapdata *map)
{ {
size_t i; size_t i;
int colorvalue; int colorvalue;
i = 0; i = 0;
while (i < ft_strlen(strcolor) - 1) while (i < ft_strlen(strcolor) - 1)
{ {
if (!ft_isdigit(strcolor[i])) if (!ft_isdigit(strcolor[i]))
{ {
ft_strlcpy(map->error, "invalid characters in color definition", 1024); ft_strlcpy(map->error, "invalid characters in color definition",
1024);
return (false); return (false);
} }
i++; i++;
@ -37,7 +38,7 @@ bool perform_color_checks(int *color, char *strcolor, t_mapdata *map)
*color = colorvalue; *color = colorvalue;
return (true); return (true);
} }
unsigned long set_color(const char *s, t_mapdata *map) unsigned long set_color(const char *s, t_mapdata *map)
{ {
int i; int i;