-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
34 lines (31 loc) · 1.18 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: telias-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/03/01 15:52:02 by telias-p #+# #+# */
/* Updated: 2021/03/01 16:13:43 by telias-p ### ########.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);
}