-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_str_formater.c
More file actions
41 lines (38 loc) · 1.27 KB
/
ft_str_formater.c
File metadata and controls
41 lines (38 loc) · 1.27 KB
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
37
38
39
40
41
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_formater.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pabad-ap <pabad-ap@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/25 21:39:52 by pabad-ap #+# #+# */
/* Updated: 2023/10/29 21:58:19 by pabad-ap ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void ft_str_formater(char *s, int *str_len)
{
int i;
int write_output;
i = 0;
write_output = 0;
if (s == NULL)
{
write_output = write(1, "(null)", 6);
if (write_output != 6)
*str_len = -1;
else
*str_len = *str_len + write_output;
return ;
}
else
{
while (s[i] != '\0')
{
ft_char_formater(s[i], str_len);
if (*str_len == -1)
return ;
i++;
}
}
}