skeletton untested project

This commit is contained in:
thrieg 2025-12-11 06:18:16 +01:00
commit 6fc620e8f4
187 changed files with 6584 additions and 0 deletions

42
libft/ft_split2.c Normal file
View file

@ -0,0 +1,42 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_split2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/09 15:37:07 by alier #+# #+# */
/* Updated: 2025/02/16 19:04:33 by thrieg ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
/*
* Free all strings duplicated by split and the pointer array itself.
* Does nothing if strs is NULL.
*/
void ft_free_split(char **strs)
{
size_t i;
if (strs == NULL)
return ;
i = 0;
while (strs[i] != NULL)
{
free(strs[i]);
i++;
}
free(strs);
}
size_t ft_split_size(char **strs)
{
size_t i;
i = 0;
while (strs[i] != NULL)
i++;
return (i);
}