mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-05 23:18:08 +01:00
29 lines
1.3 KiB
C
29 lines
1.3 KiB
C
|
|
/* ************************************************************************** */
|
||
|
|
/* */
|
||
|
|
/* ::: :::::::: */
|
||
|
|
/* ft_printf_char.c :+: :+: :+: */
|
||
|
|
/* +:+ +:+ +:+ */
|
||
|
|
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||
|
|
/* +#+#+#+#+#+ +#+ */
|
||
|
|
/* Created: 2024/11/25 14:54:42 by jguelen #+# #+# */
|
||
|
|
/* Updated: 2025/02/04 09:59:58 by jguelen ### ########.fr */
|
||
|
|
/* */
|
||
|
|
/* ************************************************************************** */
|
||
|
|
|
||
|
|
#include "ft_printf.h"
|
||
|
|
|
||
|
|
int ft_printf_percent(int fd, t_printf_format *format)
|
||
|
|
{
|
||
|
|
format->total_len = write(fd, "%", 1);
|
||
|
|
return (format->total_len);
|
||
|
|
}
|
||
|
|
|
||
|
|
int ft_printf_char(int fd, t_printf_format *format)
|
||
|
|
{
|
||
|
|
if ((format->flags & ~PRINTF_MINUSFLAG) == format->flags)
|
||
|
|
ft_pad_char(fd, format, " ");
|
||
|
|
if (write(fd, &format->var.c, 1) == -1)
|
||
|
|
return (-1);
|
||
|
|
return (ft_pad_char(fd, format, " "));
|
||
|
|
}
|