-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_allocate.c
51 lines (47 loc) · 1.37 KB
/
ft_allocate.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_allocate.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbifenzi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/19 22:23:29 by mbifenzi #+# #+# */
/* Updated: 2020/01/19 23:59:54 by mbifenzi ### ########.fr */
/* */
/* ************************************************************************** */
/*#include "ft_printf.h"
void ft_bzero(void *s, size_t n)
{
size_t i;
char *str;
i = 0;
if (n)
{
str = s;
while (n > i + 1)
{
str[i] = 0;
i++;
}
str[i] = '\0';
}
}
static void *ft_memalloc(size_t size)
{
void *mem;
if (!(mem = malloc(size)))
return (NULL);
ft_bzero(mem, size);
return (mem);
}
static t_f *ft_init_list(t_f *f)
{
if (!(f = (t_f *)ft_memalloc(sizeof(t_f))))
return (NULL);
f->i = 0;
f->len = 0;
f->precision = 0;
f->width = 0;
f->minus = 0;
return (f);
}*/