summaryrefslogtreecommitdiff
path: root/ft_putendl_fd.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_putendl_fd.c
parente3a961985bb40f2194dda91d8ecad8c17d13700d (diff)
downloadlibft-b356e8552cad748418163bf3ad1da95e88937a38.tar.gz
libft-b356e8552cad748418163bf3ad1da95e88937a38.zip
Use ft_strlen instead of rewriting it
Diffstat (limited to 'ft_putendl_fd.c')
-rw-r--r--ft_putendl_fd.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ft_putendl_fd.c b/ft_putendl_fd.c
index ab08ec4..f8de15e 100644
--- a/ft_putendl_fd.c
+++ b/ft_putendl_fd.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/06 20:47:17 by dkaiser #+# #+# */
-/* Updated: 2024/03/10 13:20:39 by dkaiser ### ########.fr */
+/* Updated: 2024/03/10 14:07:58 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,13 +14,6 @@
void ft_putendl_fd(char *s, int fd)
{
- int len;
-
- len = 0;
- while (s[len])
- {
- len++;
- }
- write(fd, s, len);
+ write(fd, s, ft_strlen(s));
write(fd, "\n", 1);
}