-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_puts.c
36 lines (33 loc) · 1.13 KB
/
ft_puts.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_puts.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vstockma <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/19 14:21:53 by vstockma #+# #+# */
/* Updated: 2022/10/19 14:21:54 by vstockma ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_puts(va_list args)
{
int i;
int len;
char *str;
i = 0;
len = 0;
str = va_arg(args, char *);
if (!str)
{
write(1, "(null)", 6);
return (6);
}
while (str[i])
{
write(1, &str[i], 1);
i++;
len++;
}
return (len);
}