new day, new sort =)

optimised sorting algorithm
This commit is contained in:
Tanguy MAZE
2019-03-08 18:10:14 +01:00
parent 3fc361618c
commit efab9452b1
4 changed files with 111 additions and 31 deletions

View File

@@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/23 13:35:15 by tmaze #+# #+# */
/* Updated: 2019/03/02 18:28:08 by tmaze ### ########.fr */
/* Updated: 2019/03/08 16:48:26 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -44,14 +44,14 @@ void exec_actions(t_psdata *data)
int read_ops(t_psdata *data)
{
t_list *nop;
char buff[5];
char *buff;
int ret;
ft_memset(buff, '\0', 5);
while ((ret = read(1, buff, 4)) > 0)
buff = NULL;
while ((ret = get_next_line(0, &buff)) > 0)
{
buff[ft_strlen(buff) - 1] = '\0';
if (ret > 4 || !is_op(buff) || (nop = ft_lstnew(buff, 4)) == NULL)
ft_printf("'%s'\n", buff);
if (ft_strlen(buff) > 4 || !is_op(buff) || (nop = ft_lstnew(buff, 4)) == NULL)
{
ft_putendl_fd("Error", 2);
return (1);