summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-10-02 19:49:34 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-10-02 19:49:34 +0200
commitec56cc2b21769f028b84a90d157c63dcd45b43ff (patch)
tree6348fe5a2a1cd918dce9402c2a6afeb17af7da14 /src
parentNormed p_args_len (diff)
download42-minishell-ec56cc2b21769f028b84a90d157c63dcd45b43ff.tar.gz
42-minishell-ec56cc2b21769f028b84a90d157c63dcd45b43ff.tar.bz2
42-minishell-ec56cc2b21769f028b84a90d157c63dcd45b43ff.tar.xz
42-minishell-ec56cc2b21769f028b84a90d157c63dcd45b43ff.tar.zst
42-minishell-ec56cc2b21769f028b84a90d157c63dcd45b43ff.zip
Normed p_args_next
Diffstat (limited to '')
-rw-r--r--src/p_args_next.c24
-rw-r--r--src/p_args_next.h6
2 files changed, 13 insertions, 17 deletions
diff --git a/src/p_args_next.c b/src/p_args_next.c
index ea8dd81..b1d11e2 100644
--- a/src/p_args_next.c
+++ b/src/p_args_next.c
@@ -18,11 +18,10 @@
#include "p_args.h"
#include "p_args_len.h"
-static char
- *p_give_me_an_arg(char tmp[],
- const char word[],
- const uint16_t i,
- const size_t start[])
+static char *p_give_me_an_arg(char tmp[],
+ const char word[],
+ const uint16_t i,
+ const size_t start[])
{
tmp[0] = '\0';
ft_strlcpy(tmp,
@@ -31,8 +30,7 @@ static char
return (tmp);
}
-void
- p_del_alloced_words(char *words[], uint16_t to_del)
+void p_del_alloced_words(char *words[], uint16_t to_del)
{
uint16_t i;
@@ -44,11 +42,10 @@ void
}
}
-uint16_t
- p_dup_words(char *words[],
- const char word[],
- const uint16_t argc,
- const size_t start[])
+uint16_t p_dup_words(char *words[],
+ const char word[],
+ const uint16_t argc,
+ const size_t start[])
{
char tmp[ARG_MAX];
uint16_t i;
@@ -57,8 +54,7 @@ uint16_t
while (i < argc)
{
if ((words[i] = ft_strdup(
- p_give_me_an_arg(tmp, word, i, start)
- )) == NULL)
+ p_give_me_an_arg(tmp, word, i, start))) == NULL)
return (i);
i++;
}
diff --git a/src/p_args_next.h b/src/p_args_next.h
index 365f228..ca794f5 100644
--- a/src/p_args_next.h
+++ b/src/p_args_next.h
@@ -10,10 +10,10 @@
/* */
/* ************************************************************************** */
-#ifndef P_ARGS_NEXT_H
-#define P_ARGS_NEXT_H
+#ifndef FT_P_ARGS_NEXT_H
+# define FT_P_ARGS_NEXT_H
-#include <stdint.h>
+# include <stdint.h>
uint16_t p_dup_words(char *words[],
const char word[],