-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint_str.c
More file actions
32 lines (29 loc) · 1.13 KB
/
Copy pathprint_str.c
File metadata and controls
32 lines (29 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_str.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amtan <amtan@student.42singapore.sg> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/28 17:47:00 by amtan #+# #+# */
/* Updated: 2025/12/05 17:00:31 by amtan ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int print_str(char *str, size_t *printed)
{
int tmp;
int ret;
if (!str)
str = "(null)";
ret = 0;
while (*str != '\0')
{
tmp = print_char((int)*str, printed);
if (tmp < 0)
return (-1);
str++;
ret += tmp;
}
return (ret);
}