Write generic error to stderr trunk
authorLukas Jiriste <ljiriste@student.42prague.com>
Thu, 5 Sep 2024 07:47:59 +0000 (09:47 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Thu, 5 Sep 2024 07:47:59 +0000 (09:47 +0200)
src/input_handling.c

index 5347db0a80e3d238afc02eb24c70c2daba78c6f4..1337955f5e246816a5b0b2cea2b43cfbefbc72ef 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/05/03 09:00:00 by ljiriste          #+#    #+#             */
-/*   Updated: 2024/08/31 11:58:46 by ljiriste         ###   ########.fr       */
+/*   Updated: 2024/09/05 09:41:13 by ljiriste         ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -14,6 +14,7 @@
 #include "minishell.h"
 #include "libft.h"
 #include <stdlib.h>
+#include <unistd.h>
 
 void   handle_input(char **input, t_execution_env *env)
 {
@@ -40,6 +41,6 @@ void  handle_input(char **input, t_execution_env *env)
        ft_vec_free(&tokens, free_token);
        ft_parse_tree_free(parse_tree);
        if (res != 0)
-               ft_printf("An error has occured.\n");
+               ft_dprintf(STDERR_FILENO, "An error has occured.\n");
        return ;
 }