tentative de debug du leaks de testt

This commit is contained in:
Hugo LAMY
2019-12-12 23:09:27 +01:00
parent 7fd709fcac
commit f2e48e7746
3 changed files with 3 additions and 11 deletions

View File

@@ -169,28 +169,18 @@ int get_next_line(int fd, char **line)
int main(int ac, char **av)
{
int fd1;
int fd2;
int i;
char *line;
line = NULL;
fd1 = open(av[1], O_RDONLY);
fd2 = open(av[2], O_RDONLY);
if (ac < 2)
return (0);
while ((i = get_next_line(fd1, &line)) > 0)
{
printf("%i", i);
printf("%s\n",line);
free(line);
if ((i = get_next_line(fd2, &line)) > 0)
{
printf("%s\n",line);
free(line);
}
printf("%i", i);
}
printf("%i", i);
while (1);
return (0);
}