Files
ft_printf/libftprintf/ft_va_string.c

32 lines
1.2 KiB
C
Raw Normal View History

2022-04-13 08:01:46 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
2022-04-29 15:18:54 +02:00
/* ft_va_string.c :+: :+: :+: */
2022-04-13 08:01:46 +02:00
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/20 11:56:37 by gbaconni #+# #+# */
2022-04-29 15:18:54 +02:00
/* Updated: 2022/04/29 14:42:58 by gbaconni ### ########.fr */
2022-04-13 08:01:46 +02:00
/* */
/* ************************************************************************** */
2022-04-29 17:50:40 +02:00
#include "ft_printf.h"
2022-04-13 08:01:46 +02:00
2022-04-29 15:18:54 +02:00
int ft_va_string(const char *format, va_list ap)
2022-04-13 08:01:46 +02:00
{
2022-04-26 17:53:39 +02:00
int ret;
char *s;
2022-04-13 08:01:46 +02:00
(void) format;
2022-04-25 07:14:14 +02:00
ret = 0;
2022-04-13 08:01:46 +02:00
s = va_arg(ap, char *);
2022-04-25 07:14:14 +02:00
if (s == NULL)
{
ret = ft_puts("(null)");
return (ret);
}
2022-04-29 15:18:54 +02:00
ret += ft_va_string_bonus(format, ap, s);
2022-04-26 17:53:39 +02:00
ret += ft_puts(s);
2022-04-13 08:01:46 +02:00
return (ret);
}