-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_proc_string.c
32 lines (29 loc) · 1.18 KB
/
ft_proc_string.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_proc_string.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: youngmki <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/09/23 19:41:15 by youngmki #+# #+# */
/* Updated: 2021/09/23 22:15:02 by youngmki ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_proc_string(t_print *tab)
{
const char *str;
int index;
index = 0;
str = va_arg(tab->args, char *);
if (str == NULL)
{
tab->total_length += write(1, "(null)", 6);
return ;
}
while (str[index] != '\0')
{
tab->total_length += write(1, &str[index], 1);
index += 1;
}
}