-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_next_line_utils.c
49 lines (42 loc) · 1.25 KB
/
get_next_line_utils.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bmerchin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/04 00:25:45 by bmerchin #+# #+# */
/* Updated: 2021/01/08 12:26:48 by bmerchin ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int ft_strlen(char *str)
{
int i;
i = 0;
if (!str)
return (0);
while (str[i] != '\0')
i++;
return (i);
}
int ft_strlenn(char *str)
{
int i;
i = 0;
if (!str)
return (0);
while (str[i] != '\0' && str[i] != '\n')
i++;
return (i);
}
char *free_null(char *s1)
{
free(s1);
return (NULL);
}
int free_int(char **line)
{
free(*line);
return (-1);
}