Rename all ft_vprintf_*.c to ft_va_*.c
This commit is contained in:
34
libftprintf/ft_va_pointer.c
Normal file
34
libftprintf/ft_va_pointer.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_va_pointer.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/01/20 11:56:16 by gbaconni #+# #+# */
|
||||
/* Updated: 2022/04/29 14:33:20 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libftprintf.h"
|
||||
|
||||
int ft_va_pointer(const char *format, va_list ap)
|
||||
{
|
||||
int ret;
|
||||
void *p;
|
||||
char *s;
|
||||
|
||||
(void) format;
|
||||
ret = 0;
|
||||
p = va_arg(ap, void *);
|
||||
if (p == NULL)
|
||||
{
|
||||
ret = ft_puts(NIL);
|
||||
return (ret);
|
||||
}
|
||||
s = ft_ltoa_base((long) p, HEXA_LOWER);
|
||||
ret += ft_puts("0x");
|
||||
ret += ft_puts(s);
|
||||
free(s);
|
||||
return (ret);
|
||||
}
|
||||
Reference in New Issue
Block a user