33 lines
1.2 KiB
C
33 lines
1.2 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_printf_memset.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: pbonilla <eirodeis.lepnj@gmail.com> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2021/03/04 05:59:48 by pbonilla #+# #+# */
|
||
|
/* Updated: 2021/03/19 19:13:48 by pbonilla ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "ft_printf.h"
|
||
|
|
||
|
void *ft_printf_memset(void *s, size_t n, t_param *param)
|
||
|
{
|
||
|
unsigned char *buff;
|
||
|
unsigned int i;
|
||
|
int c;
|
||
|
|
||
|
buff = s;
|
||
|
i = -1;
|
||
|
c = ' ';
|
||
|
if (param->prec > -1 && param->zero)
|
||
|
param->zero = 0;
|
||
|
if (param->zero && !param->minus)
|
||
|
c = '0';
|
||
|
while (++i != n)
|
||
|
*(buff + i) = c;
|
||
|
s = (void *)buff;
|
||
|
return (s);
|
||
|
}
|