Rename all ft_vprintf_*.c to ft_va_*.c

This commit is contained in:
gbaconni
2022-04-29 15:18:54 +02:00
parent 1cb8c78ae3
commit 2b5b1de944
18 changed files with 172 additions and 118 deletions

View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_va_hexadecimal.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:55:33 by gbaconni #+# #+# */
/* Updated: 2022/04/29 14:42:36 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_va_hexadecimal(const char *format, va_list ap)
{
int ret;
long l;
char *s;
char c;
ret = 0;
l = va_arg(ap, long);
c = *format;
if (c == 'x')
s = ft_ltoa_base(l, HEXA_LOWER);
else
s = ft_ltoa_base(l, HEXA_UPPER);
ret += ft_va_hexadecimal_bonus(format, ap, s);
ret += ft_puts(s);
free(s);
return (ret);
}