ca parait bon
This commit is contained in:
parent
cdc4eb5d5f
commit
3b80be7c0f
2
Makefile
2
Makefile
@ -55,6 +55,6 @@ server_re: server_fclean
|
||||
|
||||
client_re: client_fclean client
|
||||
|
||||
re: client_re server
|
||||
re: fclean all
|
||||
|
||||
.PHONY: all clean fclean re client_re client_clean client_fclean server_re server_clean server_fclean
|
||||
|
@ -25,7 +25,6 @@ void ft_char2signal(int pid, char c)
|
||||
else
|
||||
kill(pid, SIGUSR1);
|
||||
i--;
|
||||
usleep(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -26,6 +26,7 @@ void *ft_realloc(void *tab, size_t size, size_t new_size, int bytes)
|
||||
new[i] = ((char *) tab)[i];
|
||||
i++;
|
||||
}
|
||||
free(tab);
|
||||
if (tab != NULL)
|
||||
free(tab);
|
||||
return (new);
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libftx/libftx.a
BIN
libftx/libftx.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -35,7 +35,7 @@ int ft_is_finished(int *tab, size_t len)
|
||||
size_t i;
|
||||
unsigned long sum;
|
||||
|
||||
if (len >= sizeof(char) * 8 && len % sizeof(char) * 8 == 0)
|
||||
if (len >= sizeof(char) * 8 && (len % (sizeof(char) * 8)) == 0)
|
||||
{
|
||||
sum = 0;
|
||||
i = len - sizeof(char) * 8;
|
||||
@ -55,19 +55,22 @@ void handler(int num)
|
||||
static size_t len = 0;
|
||||
char *str;
|
||||
|
||||
tab = ft_realloc(tab, len, len + 1, sizeof(int));
|
||||
tab = ft_realloc(tab, len, len + 2, sizeof(int));
|
||||
if (tab == NULL)
|
||||
return ;
|
||||
if (len == 0)
|
||||
tab[0] = num;
|
||||
else
|
||||
tab[len] = num == tab[0];
|
||||
ft_printf("tab[%d] = %d\n", len, tab[len]);
|
||||
len++;
|
||||
if (ft_is_finished(tab + 1, len - 1))
|
||||
{
|
||||
str = ft_tab_int_to_str(tab + 1, len - 1);
|
||||
free(tab);
|
||||
ft_printf("%s\n", str);
|
||||
str = NULL;
|
||||
free(str);
|
||||
tab = NULL;
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user