summaryrefslogtreecommitdiff
path: root/ft_strjoin.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-03-10 14:08:27 +0100
committerDominik Kaiser2024-03-10 14:08:27 +0100
commitb356e8552cad748418163bf3ad1da95e88937a38 (patch)
treec236df689b5e74cf9a5be3ba8e1642378c8cfe1a /ft_strjoin.c
parente3a961985bb40f2194dda91d8ecad8c17d13700d (diff)
downloadlibft-b356e8552cad748418163bf3ad1da95e88937a38.tar.gz
libft-b356e8552cad748418163bf3ad1da95e88937a38.zip
Use ft_strlen instead of rewriting it
Diffstat (limited to 'ft_strjoin.c')
-rw-r--r--ft_strjoin.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/ft_strjoin.c b/ft_strjoin.c
index ebcd611..526592b 100644
--- a/ft_strjoin.c
+++ b/ft_strjoin.c
@@ -6,22 +6,12 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/07 10:15:33 by dkaiser #+# #+# */
-/* Updated: 2024/03/10 13:18:27 by dkaiser ### ########.fr */
+/* Updated: 2024/03/10 14:02:07 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
-static int get_len(char const *s)
-{
- int i;
-
- i = 0;
- while (s[i])
- i++;
- return (i);
-}
-
static int copy_str(char *dst, const char *src)
{
int i;
@@ -40,7 +30,7 @@ char *ft_strjoin(char const *s1, char const *s2)
int len;
char *result;
- len = get_len(s1) + get_len(s2);
+ len = ft_strlen(s1) + ft_strlen(s2);
result = malloc(len + 1);
if (result)
{