ca marche presques mais ça marche pas du tout

This commit is contained in:
Camille Chauvet
2023-01-08 18:03:40 +01:00
parent d7256c47a5
commit 650d9b1ab5
331 changed files with 20069 additions and 232 deletions

View File

@ -6,13 +6,13 @@
# By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/27 08:39:27 by cchauvet #+# #+# #
# Updated: 2023/01/05 20:32:04 by cchauvet ### ########.fr #
# Updated: 2023/01/08 12:35:58 by cchauvet ### ########.fr #
# #
# **************************************************************************** #
CC = clang
SRCS = ft_strchri.c ft_strcmp.c ft_strfjoin.c ft_strmerger.c ft_strndup.c ft_tabrealloc.c ft_is_in.c
SRCS = ft_strchri.c ft_strcmp.c ft_strfjoin.c ft_strmerger.c ft_strndup.c ft_tabrealloc.c ft_is_in.c ft_strgen.c
OBJS = $(SRCS:.c=.o)

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 14:03:10 by cchauvet #+# #+# */
/* Updated: 2023/01/05 20:31:50 by cchauvet ### ########.fr */
/* Updated: 2023/01/08 12:36:12 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,6 +16,7 @@
# include <stdlib.h>
# include "../libft/libft.h"
char *ft_strgen(char c, size_t len);
char *ft_strfjoin(char *s1, char *s2);
char *ft_strmerger(size_t arg_len, ...);
int ft_is_in(char *str, char c);

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/05 20:29:53 by cchauvet #+# #+# */
/* Updated: 2023/01/05 20:31:20 by cchauvet ### ########.fr */
/* Updated: 2023/01/08 12:15:08 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,6 +21,7 @@ int ft_is_in(char *str, char c)
{
if (str[i] == c)
return (1);
i++;
}
return (0);
}

Binary file not shown.

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/04 14:06:04 by cchauvet #+# #+# */
/* Updated: 2023/01/05 19:38:35 by cchauvet ### ########.fr */
/* Updated: 2023/01/08 11:13:17 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,8 +14,8 @@
char *ft_strfjoin(char *s1, char *s2)
{
ssize_t i;
ssize_t y;
size_t i;
size_t y;
char *out;
out = malloc((ft_strlen(s1) + ft_strlen(s2) + 1) * sizeof(char));
@ -29,10 +29,13 @@ char *ft_strfjoin(char *s1, char *s2)
i++;
}
free(s1);
y = -1;
y = 0;
if (s2 != NULL)
while (s2[++y] != '\0')
while (s2[y] != '\0')
{
out[i + y] = s2[y];
y++;
}
free(s2);
out[i + y] = '\0';
return (out);

Binary file not shown.

31
libftx/extra/ft_strgen.c Normal file
View File

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strgen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/08 12:32:52 by cchauvet #+# #+# */
/* Updated: 2023/01/08 14:06:32 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "extra.h"
char *ft_strgen(char c, size_t len)
{
char *out;
size_t i;
out = malloc((len + 1) * sizeof(char));
if (out == NULL)
return (NULL);
i = 0;
while (i < len)
{
out[i] = c;
i++;
}
out[len] = '\0';
return (out);
}

BIN
libftx/extra/ft_strgen.o Normal file

Binary file not shown.