-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
35 lines (32 loc) · 1.23 KB
/
main.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vinograd <vinograd@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/29 16:11:12 by vinograd #+# #+# */
/* Updated: 2019/05/29 16:14:47 by vinograd ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
int main(int argc, char **argv)
{
char *line;
int fd;
int ret;
if (argc == 2)
fd = open(argv[1], O_RDONLY);
else
fd = 0;
line = NULL;
ret = 1;
while (ret)
{
ret = get_next_line(fd, &line);
printf("%s\treturn value - %d\n", line, ret);
ft_strdel(&line);
}
close(fd);
// while (1); //for check on leaks (leaks a.out)
}