tentative de debug du leaks de testt
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
2
testt/test.txt
Normal file
2
testt/test.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
asdfghjklasdfghjklasdfghjkl
|
||||
|
||||
Reference in New Issue
Block a user