-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils2.c
More file actions
57 lines (50 loc) · 1.37 KB
/
Copy pathutils2.c
File metadata and controls
57 lines (50 loc) · 1.37 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fracerba <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/04 12:01:22 by fracerba #+# #+# */
/* Updated: 2023/12/04 12:01:24 by fracerba ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void print_matrix(char **mat)
{
int i;
i = 0;
if (!mat || !mat[i])
return ;
while (mat[i])
{
ft_printf("%s", mat[i]);
i++;
}
}
void print_matrix_nl(char **mat)
{
int i;
i = 0;
if (!mat || !mat[i])
return ;
while (mat[i])
{
ft_printf("%s\n", mat[i]);
i++;
}
}
char *better_strdup(char *str)
{
char *tmp;
if (!str)
return (NULL);
if (!ft_strlen(str))
{
tmp = malloc(sizeof(char) * 1);
tmp[0] = 0;
return (tmp);
}
else
return (ft_strdup(str));
}