-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf_other_convs_bonus.c
34 lines (31 loc) · 1.13 KB
/
ft_printf_other_convs_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_other_convs_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: asoler <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/26 00:35:24 by asoler #+# #+# */
/* Updated: 2022/05/28 15:23:48 by asoler ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf_bonus.h"
int ft_printf_char(char c)
{
write(1, &c, 1);
return (0);
}
int ft_printf_str(char *s)
{
if (s)
{
write(1, s, ft_strlen(s));
return (ft_strlen(s) - 1);
}
else
{
write(1, "(null)", 6);
return (5);
}
return (0);
}