42_cub3d/libft/ft_strncmp.c
mcolonna 40d8462689 Add map checks *
add:
- check if map is surronded by walls
- check file extension
dev:
- Makefile: now can include libraries
- add library libft
- add testmaps
- norm
2024-10-10 13:40:39 +02:00

25 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncmp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/10 12:21:33 by mcolonna #+# #+# */
/* Updated: 2023/10/10 14:39:03 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_strncmp(const char *s1, const char *s2, size_t n)
{
unsigned int i;
if (n == 0)
return (0);
i = 0;
while (i < n - 1 && s1[i] && s1[i] == s2[i])
i++;
return ((unsigned char)s1[i] - (unsigned char)s2[i]);
}