/* ************************************************************************** */ /* */ /* ::: o_ :::::: ::: */ /* print_unumber.c :+: / :+::+: :+: */ /* +:+ > +:++:+ +:+ */ /* By: whaffman +#+ +:+ +#++#++:++#++ */ /* +#+ +#+#+ +#++#+ +#+ \o/ */ /* Created: 2024/10/27 16:32:36 by whaffman #+#+# #+#+# #+# #+# | */ /* Updated: 2024/10/27 16:32:49 by whaffman ### ### ### ### / \ */ /* */ /* ************************************************************************** */ #include #include #include #include "libft.h" #include "ft_printf.h" int print_unumber(va_list args) { long n; size_t len; char *str; int wrote; wrote = 0; str = ft_calloc(sizeof(char), 12); if (!str) return (-1); n = va_arg(args, unsigned int); ft_putnbr_base(n, "0123456789", str); len = ft_strlen(str); wrote = write(1, str, len); free(str); return (wrote); }