diff options
-rw-r--r-- | src/p_split.c | 14 | ||||
-rw-r--r-- | src/s_struct.h | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/p_split.c b/src/p_split.c index 25f1cc7..482bc58 100644 --- a/src/p_split.c +++ b/src/p_split.c @@ -211,6 +211,15 @@ static t_split return (sp); } +static char +**p_get_words(const char line[], const t_split sp) +{ + char **words; + + words = NULL; + return (words); +} + char **p_split_line(char line[]) { @@ -219,6 +228,11 @@ char words = NULL; sp = p_fill_sp(line); + if ((words = p_get_words(line, sp)) == NULL) + { + ft_memdel((void*)&line); + return (NULL); + } ft_memdel((void*)&line); return (words); } diff --git a/src/s_struct.h b/src/s_struct.h index f7ea271..2734618 100644 --- a/src/s_struct.h +++ b/src/s_struct.h @@ -14,6 +14,7 @@ #define S_STRUCT_H #include <stdint.h> +#include <limits.h> #include "d_define.h" @@ -59,7 +60,7 @@ struct s_lpipes typedef struct s_line_block { - char lblock[4096]; + char lblock[ARG_MAX]; uint8_t nextif; struct s_line_block *next; } t_line_block; |