-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_putchar.c
22 lines (20 loc) · 1.03 KB
/
ft_putchar.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: arcanava <arcanava@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/06 21:06:22 by arcanava #+# #+# */
/* Updated: 2024/04/22 22:19:42 by arcanava ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_putchar(int fd, const char *c, int *counter)
{
if (write(fd, c, 1) == -1)
*counter = -1;
else
(*counter)++;
return (*counter);
}