-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathold_funct.c
More file actions
43 lines (41 loc) · 1.37 KB
/
old_funct.c
File metadata and controls
43 lines (41 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* old_funct.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: passef <passef@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/01/18 11:54:24 by passef #+# #+# */
/* Updated: 2018/01/18 11:54:30 by passef ### ########.fr */
/* */
/* ************************************************************************** */
int get_map_size(t_env *e)
{
int j;
j = 0;
if (!read(e->map_fd, e->map_params, 25))
return (0);
while (e->map_params[e->i] != '\n')
{
if (e->map_params[e->i] == 'x')
{
e->i++;
if (!ft_isdigit(e->map_params[e->i]))
return (0);
j = 0;
while (ft_isdigit(e->map_params[e->i]))
{
e->n2[j] = e->map_params[e->i];
e->i++;
j++;
}
return (1);
}
if (!ft_isdigit(e->map_params[e->i]))
return (0);
e->n1[j] = e->map_params[e->i];
e->i++;
j++;
}
return (1);
}