12345678910111213141516171819202122232425262728 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_strnequ.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2014/11/06 18:27:18 by mazimi #+# #+# */
- /* Updated: 2014/12/08 15:50:50 by mazimi ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- int ft_strnequ(char const *s1, char const *s2, size_t n)
- {
- if (s1 == NULL || s2 == NULL)
- return (0);
- if (n == 0)
- return (1);
- if (*s1 == '\0' && *s2 == '\0')
- return (1);
- if (n == 1 && *s1 == *s2)
- return (1);
- if (*s1 == *s2 && n)
- return (ft_strnequ(s1 + 1, s2 + 1, n - 1));
- return (0);
- }
|