-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putchar_fd.c
21 lines (19 loc) · 1 KB
/
ft_putchar_fd.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar_fd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: asoudani <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/26 18:27:59 by asoudani #+# #+# */
/* Updated: 2024/11/14 21:16:20 by asoudani ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putchar_fd(char c, int fd, int *n)
{
if (write(fd, &c, 1) == -1)
return (-1);
*n += 1;
return (1);
}