FIX first part of mandatory functions
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/05 17:54:17 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/11/05 17:59:54 by dgaillet ### ########lyon.fr */
|
||||
/* Updated: 2025/11/06 11:13:18 by dgaillet ### ########lyon.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
void *ft_memchr(const void *s, int c, size_t n)
|
||||
{
|
||||
if (n > 0 && *((unsigned char *) s) == c)
|
||||
return ((void *) s);
|
||||
if (n <= 0)
|
||||
return (NULL);
|
||||
if (*(unsigned char *) s == (unsigned char) c)
|
||||
return ((void *) s);
|
||||
return (ft_memchr(s + 1, c, n - 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user