libft/sources/libft_srcs/ft_strncmp.c
int		ft_strncmp(const char *s1, const char *s2, size_t n)
{
	size_t i;

	i = 0;
	if (s1 == s2 || n == 0)
		return (0);
	while (i < n)
	{
		if (s1[i] != s2[i] || s1[i] == '\0' || s2[i] == '\0')
		{
			return (((unsigned char*)s1)[i] - ((unsigned char*)s2)[i]);
		}
		i = i + 1;
	}
	return (0);
}
/*
** The strcmp() and strncmp() functions lexicographically compare
** the null-terminated strings s1 and s2.
** The strncmp() function compares not more than n characters.
** Because strncmp() is designed for comparing strings rather than binary data,
** characters that appear after a `\0' character are not compared.
*/
The strcmp() and strncmp() functions lexicographically compare
the null-terminated strings s1 and s2.
The strncmp() function compares not more than n characters.
Because strncmp() is designed for comparing strings rather than binary data,
characters that appear after a `\0' character are not compared.
The strcmp () and strncmp () functions lexicographically compare the null - terminated strings s1 and s2 . The strncmp () function compares not more than n characters . Because strncmp () is designed for comparing strings rather than binary data characters that appear after a ` \ 0 ' character are not compared .
int		ft_strncmp(const char *s1, const char *s2, size_t n)
{
	size_t i;
	i = 0;
	if (s1 == s2 || n == 0)
		return (0);
	while (i < n)
	{
		if (s1[i] != s2[i] || s1[i] == '\0' || s2[i] == '\0')
		{
			return (((unsigned char*)s1)[i] - ((unsigned char*)s2)[i]);
		}
		i = i + 1;
	}
	return (0);
}
int ft_strncmp ( const char * s1 , const char * s2 , size_t n ) { size_t i ; i = 0 ; if ( s1 == s2 || n == 0 ) return ( 0 ) ; while ( i < n ) { if ( s1 [ i ] != s2 [ i ] || s1 [ i ] == ' \0 ' || s2 [ i ] == ' \0 ' ) { return ( ( ( unsigned char * ) s1 ) [ i ] - ( ( unsigned char * ) s2 ) [ i ] ) ; } i = i + 1 ; } return ( 0 ) ; }
The strcmp() and strncmp() functions lexicographically compare
the null-terminated strings s1 and s2.
The strcmp () and strncmp () functions lexicographically compare the null - terminated strings s1 and s2 .