-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain2.c
29 lines (26 loc) · 1.11 KB
/
main2.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rfabre <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/10 21:55:46 by rfabre #+# #+# */
/* Updated: 2017/02/12 23:25:35 by jecarol ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
#include <stdio.h>
int main(int ac, char **av)
{
int fd;
char *buf;
if (ac != 2)
return (0);
fd = open(av[1], O_RDONLY);
while (get_next_line(fd, &buf) > 0)
{
printf("%s\n", buf);
ft_strdel(&buf);
}
}