-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putstr.c
26 lines (23 loc) · 1.1 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: stales <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/04 18:54:35 by stales #+# #+# */
/* Updated: 2022/04/20 16:36:47 by stales ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
#include <unistd.h>
int ft_putstr(char const *s, char end)
{
char *tmp;
if (!s)
return (ft_putstr("(null)", 0));
tmp = (char *)s;
while (*tmp && *tmp != end)
tmp++;
return (write(1, s, tmp - s));
}