added bgoulard lib + made lib sources in their own directory in build/ for readability

This commit is contained in:
B.Goulard 2024-11-01 00:00:14 +01:00
parent 83cc8419a0
commit 0a390934d6
457 changed files with 21807 additions and 61 deletions

View file

@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test_striteri.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/26 11:39:56 by bgoulard #+# #+# */
/* Updated: 2024/06/02 08:11:48 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_string.h"
static void local_iteri(unsigned int i, char *c)
{
*c = 'a';
(void)i;
}
// last 2 calls are to test NULL protection
int test_striteri(void)
{
char str[20];
ft_strlcpy(str, "Hello World!", 20);
ft_striteri(str, &local_iteri);
if (ft_strcmp(str, "aaaaaaaaaaaa") != 0)
return (1);
ft_striteri(NULL, &local_iteri);
ft_striteri(str, NULL);
return (0);
}