Rename all ft_vprintf_*.c to ft_va_*.c
This commit is contained in:
33
libftprintf/ft_va_hexadecimal.c
Normal file
33
libftprintf/ft_va_hexadecimal.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user