-
Notifications
You must be signed in to change notification settings - Fork 0
/
prf_print_s.c
31 lines (28 loc) · 1.2 KB
/
prf_print_s.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* prf_print_s.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aklein <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/30 02:16:47 by aklein #+# #+# */
/* Updated: 2023/11/14 20:16:14 by aklein ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int print_s(t_print *print)
{
char *my_str;
my_str = va_arg(print->ap, char *);
if (!my_str)
{
if (!ft_safe_putstr_fd("(null)", print->fd))
return (0);
print->printed += 6;
return (1);
}
if (!ft_safe_putstr_fd(my_str, print->fd))
return (0);
print->printed += ft_strlen(my_str);
return (1);
}