-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_putnbr_base.c
26 lines (23 loc) · 1.1 KB
/
ft_putnbr_base.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_putnbr_base.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: asilva <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/05 14:55:18 by asilva #+# #+# */
/* Updated: 2021/11/17 13:35:55 by asilva ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_putnbr_base(int fd, ssize_t nb, char base, char format)
{
int bytes;
bytes = 0;
if (nb < 0)
{
bytes += write(1, "-", 1);
nb = -nb;
}
return (ft_putunbr_base(fd, nb, base, format) + bytes);
}