32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: o_ :::::: ::: */
|
|
/* print_string.c :+: / :+::+: :+: */
|
|
/* +:+ > +:++:+ +:+ */
|
|
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#++#++:++#++ */
|
|
/* +#+ +#+#+ +#++#+ +#+ \o/ */
|
|
/* Created: 2024/10/27 16:31:48 by whaffman #+#+# #+#+# #+# #+# | */
|
|
/* Updated: 2024/10/27 16:32:23 by whaffman ### ### ### ### / \ */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <stdarg.h>
|
|
#include <unistd.h>
|
|
#include "libft.h"
|
|
#include "ft_printf.h"
|
|
|
|
int print_string(va_list args)
|
|
{
|
|
char *str;
|
|
size_t len;
|
|
|
|
str = va_arg(args, char *);
|
|
if (!str)
|
|
{
|
|
write(1, "(null)", 6);
|
|
return (6);
|
|
}
|
|
len = ft_strlen(str);
|
|
return (write(1, str, len));
|
|
}
|