From 2ad9527e08febe415c01510b39ec1b927960b176 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 15 Aug 2020 15:18:46 +0200 Subject: Cleaner --- src/b_cd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/b_cd.c') diff --git a/src/b_cd.c b/src/b_cd.c index 9833172..2248a89 100644 --- a/src/b_cd.c +++ b/src/b_cd.c @@ -28,11 +28,11 @@ static void char *args[], t_msh *msh) { - if (!(*path = ft_strdup(*args))) + if ((*path = ft_strdup(*args)) == NULL) { f_alloc_and_destroy_msh(msh); } - if (!ft_strncmp("~/", *path, 2) || !ft_strncmp("~", *path, 2)) + if (ft_strncmp("~/", *path, 2) == 0 || !ft_strncmp("~", *path, 2)) { if (!(*path = ft_strsubst(*path, "~", u_get_var_value("$HOME", msh)))) -- cgit v1.2.3