From ec56cc2b21769f028b84a90d157c63dcd45b43ff Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 2 Oct 2020 19:49:34 +0200 Subject: Normed p_args_next --- src/p_args_next.c | 24 ++++++++++-------------- src/p_args_next.h | 6 +++--- 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 +# include uint16_t p_dup_words(char *words[], const char word[], -- cgit v1.2.3