-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_bzero.c
More file actions
40 lines (35 loc) · 1.26 KB
/
Copy pathft_bzero.c
File metadata and controls
40 lines (35 loc) · 1.26 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_bzero.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yyefimov <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/18 14:50:41 by yyefimov #+# #+# */
/* Updated: 2017/02/18 14:51:11 by yyefimov ### ########.fr */
/* */
/* ************************************************************************** */
#include "printf.h"
void ft_bzero(void *data, size_t n)
{
unsigned char *res;
size_t i;
i = 0;
res = (unsigned char *)data;
while (i < n)
{
res[i] = 0;
i++;
}
}
char *wide_char(int c)
{
unsigned char tr[4];
tr[0] = (c >> 12) + 224;
tr[1] = (c >> 6) << 2;
tr[1] = (tr[1] >> 2) + 128;
tr[2] = (c << 2);
tr[2] = (tr[2] >> 2) + 128;
tr[3] = 0;
return (ft_strdup((char *)tr));
}