-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmem_utils.c
More file actions
37 lines (33 loc) · 1.19 KB
/
mem_utils.c
File metadata and controls
37 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mem_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ilnassi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/06 11:51:34 by ilnassi #+# #+# */
/* Updated: 2025/03/11 14:56:19 by ilnassi ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipex.h"
void free_paths(char *str, char **arr)
{
int i;
if (str != NULL)
free(str);
if (arr != NULL)
{
i = 0;
while (arr[i])
{
free(arr[i]);
i++;
}
free(arr);
}
}
void verify_cmd_path(char *cmd_path, t_pipex *pipex)
{
if (!cmd_path)
error_close("Not found!", EXIT_FAILURE, pipex);
}