-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr.c
31 lines (28 loc) · 1.14 KB
/
ft_putstr.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dshatilo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/08 17:22:45 by dshatilo #+# #+# */
/* Updated: 2023/11/09 10:11:43 by dshatilo ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putstr(char *s)
{
size_t printed_num;
int write_res;
printed_num = 0;
write_res = 0;
while (*s)
{
write_res = ft_putchar(*s);
if (write_res == -1)
return (write_res);
s++;
printed_num += write_res;
}
return (printed_num);
}