Revert "got a working sort"

This reverts commit 2d351417dc.
This commit is contained in:
vagrant
2019-03-06 16:24:42 +00:00
parent 2d351417dc
commit 770bfc428d
3 changed files with 31 additions and 36 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/06 16:08:02 by tmaze ### ########.fr */
/* Updated: 2019/03/02 18:28:08 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
@@ -48,14 +48,12 @@ int read_ops(t_psdata *data)
int ret;
ft_memset(buff, '\0', 5);
while ((ret = read(0, buff, 4)) > 0)
while ((ret = read(1, buff, 4)) > 0)
{
printf("buff '%s'\n", buff);
buff[ft_strlen(buff) - 1] = '\0';
printf("buff '%s'\n", buff);
if (ret > 4 || !is_op(buff) || (nop = ft_lstnew(buff, 4)) == NULL)
{
dprintf(2, "Error op %d %d '%s'", ret > 4, !is_op(buff), buff);
ft_putendl_fd("Error", 2);
return (1);
}
ft_lstaddend(&(data->op), nop);