33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_vprintf_decimal.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/01/20 11:55:02 by gbaconni #+# #+# */
|
|
/* Updated: 2022/04/14 21:49:13 by gbaconni ### lausanne.ch */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libftprintf.h"
|
|
|
|
int ft_vprintf_decimal(const char *format, va_list ap)
|
|
{
|
|
int ret;
|
|
int len;
|
|
int d;
|
|
char *s;
|
|
|
|
(void) format;
|
|
ret = 0;
|
|
len = 0;
|
|
d = va_arg(ap, int);
|
|
s = ft_itoa(d);
|
|
len = ft_strlen(s);
|
|
write(1, s, len);
|
|
ret += len;
|
|
free(s);
|
|
return (ret);
|
|
}
|