1
0
libft_new/print/printf/ft_putstr.c

32 lines
1.1 KiB
C
Raw Normal View History

2023-11-03 16:21:15 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
2024-02-04 15:11:02 +01:00
/* ft_putstr.c :+: :+: :+: */
2023-11-03 16:21:15 +01:00
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/31 11:45:55 by adjoly #+# #+# */
2024-02-04 15:11:02 +01:00
/* Updated: 2023/11/20 15:51:38 by adjoly ### ########.fr */
2023-11-03 16:21:15 +01:00
/* */
/* ************************************************************************** */
2024-02-04 15:11:02 +01:00
#include "ft_printf.h"
2023-11-03 16:21:15 +01:00
2024-02-04 15:11:02 +01:00
int ft_putstr(char *s)
2023-11-03 16:21:15 +01:00
{
int i;
i = 0;
2023-11-05 15:12:25 +01:00
if (s == NULL)
2024-02-04 15:11:02 +01:00
{
write(1, "(null)", 6);
return (6);
}
2023-11-03 16:21:15 +01:00
while (s[i])
{
2024-02-04 15:11:02 +01:00
write(1, &s[i], 1);
2023-11-03 16:21:15 +01:00
i++;
}
2024-02-04 15:11:02 +01:00
return (i);
2023-11-03 16:21:15 +01:00
}