text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_memcmp.c                                        :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: zurag <zurag@student.42.fr>                +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2021/04/20 17:14:31 by zurag             #+#    #+#             */
  /*   Updated: 2021/04/22 15:12:15 by zurag            ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  int	ft_memcmp(const void *s1, const void *s2, size_t n)
  {
  	size_t	i;
  
  	i = 0;
  	while (i < n)
  	{
  		if (((unsigned char *)s1)[i] < ((unsigned char *)s2)[i])
  			return (((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]);
  		if (((unsigned char *)s1)[i] > ((unsigned char *)s2)[i])
  			return (((unsigned char *)s1)[i] - ((unsigned char *)s2)[i]);
  		i++;
  	}
  	return (0);
  }
  