summaryrefslogtreecommitdiffstats
path: root/src/s_com.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/s_com.c')
-rw-r--r--src/s_com.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/s_com.c b/src/s_com.c
index d304675..baa6401 100644
--- a/src/s_com.c
+++ b/src/s_com.c
@@ -30,21 +30,17 @@
** TODO: norme
*/
-static int8_t
- s_fill_com(char *words[], t_com **com)
+static int8_t s_fill_com(char *words[], t_com **com)
{
uint64_t i;
uint64_t j;
- if (words[0] != NULL)
- {
- if (((*com)->bin = (char*)malloc((ft_strlen(words[0]) + 1) *
- sizeof(char))) == NULL)
- return (-1);
- ft_strlcpy((*com)->bin, words[0], ft_strlen(words[0]) + 1);
- }
- else
+ if (words[0] == NULL)
return (0);
+ if (((*com)->bin = (char*)malloc((ft_strlen(words[0]) + 1)
+ * sizeof(char))) == NULL)
+ return (-1);
+ ft_strlcpy((*com)->bin, words[0], ft_strlen(words[0]) + 1);
i = 0;
while (words[i] != NULL)
i++;
@@ -61,8 +57,7 @@ static int8_t
return (0);
}
-static void
- s_com_cpy_env_fork(t_com **com, t_msh *msh)
+static void s_com_cpy_env_fork(t_com **com, t_msh *msh)
{
size_t i;
size_t j;
@@ -82,8 +77,7 @@ static void
(*com)->env_fork[j] = NULL;
}
-void
- s_com_destroy(t_com **com)
+void s_com_destroy(t_com **com)
{
t_com *ptr;
@@ -99,8 +93,7 @@ void
}
-t_com
- *s_com_new(char word[], t_msh *msh)
+t_com *s_com_new(char word[], t_msh *msh)
{
char nword[ARG_MAX];
t_com *com;