libft/sources/pf_srcs/process_u.c
void	ft_prec_u(t_format *f)
{
	char	*tmp;
	char	*res;
	size_t	len;

	if (f->out_str[0] == '0' && f->precision == 0)
		f->out_str[0] = '\0';
	else if (f->precision > (int)ft_strlen(f->out_str))
	{
		len = f->precision - ft_strlen(f->out_str);
		tmp = ft_strnew(len);
		ft_memset((void*)tmp, 48, len);
		res = ft_strjoin(tmp, f->out_str);
		free(f->out_str);
		free(tmp);
		f->out_str = res;
	}
}
/*
** Precision and Width for 'di'
*/
Precision and Width for 'di'
Precision and Width for ' di '
void	ft_prec_u(t_format *f)
{
	char	*tmp;
	char	*res;
	size_t	len;
	if (f->out_str[0] == '0' && f->precision == 0)
		f->out_str[0] = '\0';
	else if (f->precision > (int)ft_strlen(f->out_str))
	{
		len = f->precision - ft_strlen(f->out_str);
		tmp = ft_strnew(len);
		ft_memset((void*)tmp, 48, len);
		res = ft_strjoin(tmp, f->out_str);
		free(f->out_str);
		free(tmp);
		f->out_str = res;
	}
}
void ft_prec_u ( t_format * f ) { char * tmp ; char * res ; size_t len ; if ( f -> out_str [ 0 ] == ' ' && f -> precision == 0 ) f -> out_str [ 0 ] = ' \0 ' ; else if ( f -> precision > ( int ) ft_strlen ( f -> out_str ) ) { len = f -> precision - ft_strlen ( f -> out_str ) ; tmp = ft_strnew ( len ) ; ft_memset ( ( void * ) tmp , 48 , len ) ; res = ft_strjoin ( tmp , f -> out_str ) ; free ( f -> out_str ) ; free ( tmp ) ; f -> out_str = res ; } }
Precision and Width for 'di'
Precision and Width for ' di '