d968f6dfix(memmove, strchr): memmove -> remove unnecessary check; strcht -> correctly cast to c to char
2 files changed, +3, -5
author
mogi <git@mogiya.dev> on 17-04-2026 16:47 UTC+1
committer
mogi <git@mogiya.dev> on 17-04-2026 16:47 UTC+1
parent79934d1
+1, -3
    @@ -6,7 +6,7 @@
 6 6 /*   By: mleitao <mleitao@student.42.fr>            +#+  +:+       +#+        */
 7 7 /*                                                +#+#+#+#+#+   +#+           */
 8 8 /*   Created: 2026/03/09 22:00:28 by mleitao           #+#    #+#             */
 9  -/*   Updated: 2026/04/14 19:20:28 by mleitao          ###   ########.fr       */
   9+/*   Updated: 2026/04/17 16:47:07 by mleitao          ###   ########.fr       */
1010 /*                                                                            */
1111 /* ************************************************************************** */
1212 
    @@ -17,8 +17,6 @@ void	*ft_memmove(void *dest, const void *src, size_t n)
1717 	unsigned char		*d;
1818 	const unsigned char	*s;
1919 
20  -	if (dest == src || !n)
21  -		return (dest);
2220 	d = dest;
2321 	s = src;
2422 	if (d < s)
+2, -2
    @@ -6,7 +6,7 @@
 6 6 /*   By: mleitao <mleitao@student.42.fr>            +#+  +:+       +#+        */
 7 7 /*                                                +#+#+#+#+#+   +#+           */
 8 8 /*   Created: 2026/03/11 16:59:20 by mleitao           #+#    #+#             */
 9  -/*   Updated: 2026/04/14 19:21:59 by mleitao          ###   ########.fr       */
   9+/*   Updated: 2026/04/17 16:47:13 by mleitao          ###   ########.fr       */
1010 /*                                                                            */
1111 /* ************************************************************************** */
1212 
    @@ -16,7 +16,7 @@ char	*ft_strchr(const char *s, int c)
1616 {
1717 	while (*s && *s != (char)c)
1818 		s++;
19  -	if (!*s && c)
  19+	if (!*s && (char)c)
2020 		return (NULL);
2121 	return ((char *)s);
2222 }