netwhat/libft/tests/mandatory/memchr/test8.c

32 lines
1.1 KiB
C
Raw Normal View History

2023-03-07 05:20:37 +01:00
/* ************************************************************************** */
/* */
2023-10-26 18:33:15 +02:00
/* :::::::: */
/* test8.c :+: :+: */
/* +:+ */
/* By: houtworm <codam@houtworm.net> +#+ */
/* +#+ */
/* Created: 2023/02/21 03:03:52 by houtworm #+# #+# */
/* Updated: 2023/10/18 17:09:54 by houtworm ######## odam.nl */
2023-03-07 05:20:37 +01:00
/* */
/* ************************************************************************** */
#include "../../tmp/libft.h"
#include <stdio.h>
#include <string.h>
int main(void)
{
int r;
char *s;
char *p;
r = 0;
s = malloc(8 * 8);
memcpy(s, "H\0he\0\0o", 7);
p = ft_memchr(s, 'e', 4);
if (memcmp(p, "e\0\0o", 4))
r = 1;
free(s);
return (r);
}