From 49b6183dc0171ac040bdd2faf6f8efa0448567c5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 19 Sep 2020 16:59:38 +0200 Subject: Cleaner variables handling $0 $1 $2 $3 --- src/f_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/f_alloc.c') diff --git a/src/f_alloc.c b/src/f_alloc.c index 641bc9f..c1e0c76 100644 --- a/src/f_alloc.c +++ b/src/f_alloc.c @@ -26,7 +26,7 @@ void char tmp[255]; s_line_clear(&msh->curr); - ft_strlcpy(tmp, msh->shname, ft_strlen(msh->shname) + 1); + ft_strlcpy(tmp, msh->argv[0], 255); s_destroy(msh); ft_dprintf(STDERR_FILENO, "%s: %s\n", tmp, strerror(errno)); exit(FT_RET_ALLOC); @@ -36,5 +36,5 @@ void f_alloc_and_clear_line(t_msh *msh) { s_line_clear(&msh->curr); - ft_dprintf(STDERR_FILENO, "%s: %s\n", msh->shname, strerror(errno)); + ft_dprintf(STDERR_FILENO, "%s: %s\n", msh->argv[0], strerror(errno)); } -- cgit v1.2.3