libft
ft_strnequ.c
Go to the documentation of this file.
1 /* ************************************************************************** */
3 /* */
4 /* ::: :::::::: */
5 /* ft_strnequ.c :+: :+: :+: */
6 /* +:+ +:+ +:+ */
7 /* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8 /* +#+#+#+#+#+ +#+ */
9 /* Created: 2019/09/05 00:51:03 by unite #+# #+# */
10 /* Updated: 2020/07/16 02:42:43 by unite ### ########.fr */
11 /* */
12 /* ************************************************************************** */
13 
14 #include "libft.h"
15 
26 int ft_strnequ(char const *s1, char const *s2, size_t n)
27 {
28  if (!s1 && !s2)
29  return (1);
30  else if (!s1 || !s2)
31  return (0);
32  while ((*s1 || *s2) && n-- > 0)
33  {
34  if (*s1 != *s2)
35  return (0);
36  s1++;
37  s2++;
38  }
39  return (1);
40 }
ft_strnequ
int ft_strnequ(char const *s1, char const *s2, size_t n)
Checks that two strings are unequal.
Definition: ft_strnequ.c:26
libft.h